Name:

rationalmode global variable controlling if rational arithmetic is used or not.

Library names:

void sollya_lib_set_rationalmode_and_print(sollya_obj_t) void sollya_lib_set_rationalmode(sollya_obj_t) sollya_obj_t sollya_lib_get_rationalmode()

Usage:

rationalmode = activation value : on|off -> void rationalmode = activation value ! : on|off -> void rationalmode : on|off

Parameters:

Description:

Example 1:

   > rationalmode=off!;
   > 19/17 + 3/94;
   1.1495619524405506883604505632040050062578222778473
   > rationalmode=on!;
   > 19/17 + 3/94;
   1837 / 1598

Example 2:

   > rationalmode=off!;
   > exp(19/17 + 3/94);
   3.1568097739551413675470920894482427634032816281442
   > rationalmode=on!;
   > exp(19/17 + 3/94);
   3.1568097739551413675470920894482427634032816281441796574919218482279430946893345552216426846046106958476007343642301414070837350944742638603202067315578460693359375

Example 3:

   > prec = 12!;
   > rationalmode=off!;
   > r = 0.1;
   > r == 1/10;
   false
   > rationalmode=on!;
   > s = 0.1;
   > s == 1/10;
   true
   > r == s;
   false
   > r;
   0.100006103515625
   > s;
   0.1
See also: on, off, numerator, denominator, simplify, rationalapprox, autosimplify
Go back to the list of commands