## 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:

• activation value controls if rational arithmetic should be used or not

## Description:

• rationalmode is a global variable. When its value is off, which is the default, Sollya will not use rational arithmetic to simplify expressions. All computations, including the evaluation of constant expressions given on the Sollya prompt, will be performed using floating-point and interval arithmetic. Constant expressions will be approximated by floating-point numbers, which are in most cases faithful roundings of the expressions, when shown at the prompt.
• When the value of the global variable rationalmode is on, Sollya will use rational arithmetic when simplifying expressions. Constant expressions, given at the Sollya prompt, will be simplified to rational numbers and displayed as such when they are in the set of the rational numbers. Otherwise, flaoting-point and interval arithmetic will be used to compute a floating-point approximation, which is in most cases a faithful rounding of the constant expression.

## 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.1568097739551413675470920894482427634032816281442