Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Change language to: English - Français - Português - 日本語 -
Справка Scilab >> Polynomials > simp_mode

simp_mode

toggle rational simplification

Syntax

mod = simp_mode()
simp_mode(mod)

mod

a boolean

Description

rational simplification is called after nearly each operations on rationals. It is possible to toggle simplification on or off using simp_mode function.

simp_mode(%t) set rational simplification mode on

simp_mode(%f) set rational simplification mode off

mod=simp_mode() returns in mod the current rational simplification mode

Examples

s = %s;
mod = simp_mode()
simp_mode(%f); [0/s, s/s, s^2/s, (s*(1-s))^2/(s-s^2), (s-s^2)/(s*(1-s))^2]
simp_mode(%t); [0/s, s/s, s^2/s, (s*(1-s))^2/(s-s^2), (s-s^2)/(s*(1-s))^2]
simp_mode(mod);
--> mod = simp_mode()
mod  =
T

--> simp_mode(%f); [0/s, s/s, s^2/s, (s*(1-s))^2/(s-s^2), (s-s^2)/(s*(1-s))^2]
ans  =
0  s  s²  s² -2s³ +s⁴     s -s²
-  -  --  -----------  -----------
s  s  s      s -s²     s² -2s³ +s⁴

--> simp_mode(%t); [0/s, s/s, s^2/s, (s*(1-s))^2/(s-s^2), (s-s^2)/(s*(1-s))^2]
ans  =
0  1  s  s -s²    -1
-  -  -  -----  ------
1  1  1    1    -s +s²