Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how is precision in sage?

sage: floor(sqrt(2)*sqrt(2.)/2)==1

true

sage: (sqrt(2.)*sqrt(2.)/2)==1.0

false

sage: (sqrt(2.)*sqrt(2.)/2)

1.00000000000000 sage :((2^(1/2.))== sqrt(2.))

true

sage: (((2.^(1/2))* sqrt(2.)) == 2.)

false

why it happen about approximate????

how is precision Rounding error in sage?sqrt(2) in Sage

sage: floor(sqrt(2)*sqrt(2.)/2)==1In the following code,

true

sage: (sqrt(2.)*sqrt(2.)/2)==1.0

false

floor(sqrt(2)*sqrt(2.)/2)==1 True sage: (sqrt(2.)*sqrt(2.)/2)

(sqrt(2.)*sqrt(2.)/2)==1.0 False sage: (sqrt(2.)*sqrt(2.)/2) 1.00000000000000 sage :((2^(1/2.))== sqrt(2.))

true

sqrt(2.)) True sage: (((2.^(1/2))* sqrt(2.)) == 2.)

false

2.) False

why it happen about approximate????is there an approximation error?