Transforming Scientific Notation - Scheme

I am trying to do simple subtraction arithmetic on two very large numbers.

(- 1.8305286640724363e+023 (floor 1.8305286640724363e+023))

When I do this, I get a result of 0.0. I expect the output:

(- 1.8305286640724363e+023 (floor 1.8305286640724363e+023)) => .2439521

An extended scientific designation will give me this answer.

183052866407243622723319.24395251 - 183052866407243622723319.00 = .2439521

I would like to represent these numbers as they are, with decimal numbers in place, unlike scientific notation, so I can achieve the desired result. Is there a way to do this in the framework of the Scheme? Any help, guide or link would be greatly appreciated :)

I am using DrRacket for Windows 64bit and R5RS Language.

EDIT

I thought that I would be as specific as possible with regard to the example of the arithmetic I am performing.

arithmetic:

(* 271979577247970257395 0.6180339887) => 1.6809262297150285e+020

yeilds = > 168092622971502827156.7975214365

:

(exact (* 271979577247970257395 0.6180339887)) => exact: undefined;
(inexact (* 271979577247970257395 0.6180339887)) => inexact: undefined;

, R5RS /? , , , :

(inexact->exact (* 271979577247970257395 0.6180339887)) => 168092622971502854144

:

(exact->inexact (* 271979577247970257395 0.6180339887)) => 1.6809262297150285e+020

, Big Float, - :

(bf-precision 128)
(bf (* 271979577247970257395 0.6180339887)) => (bf 168092622971502854144)

, . , , , , ! , , , , SCHEME. !:)

+5
2

, , .

:

> 183052866407243622723319.24395251
1.8305286640724363e+23

> 183052866407243622723319.00
1.8305286640724363e+23

, , () . , 0.

Racket. Racket IEEE 64- . .

, bigfloats .

(require math/bigfloat)
(bf-precision 128) ; use 128 bits
(bf- (bf #e183052866407243622723319.24395251)
     (bfround (bf #e183052866407243622723319.00)))

:   (bf # e0.2439525099999997337363311089575290679932)

. bigfloats, , ​​ Racket.

: , .2439521 , .2439521 .

Update:

, bigfloat->flonum.

(bf-precision 256)  ; to get more decimal digits correct
(bigfloat->flonum
   (bf- (bf #e183052866407243622723319.24395251)
        (bfround (bf #e183052866407243622723319.00))))

: 0.24395251

:

Racket ( Scheme) . #e, ( ). , . , exact->inexact, . :

> (exact->inexact 
     (- #e183052866407243622723319.24395251
        #e183052866407243622723319.00))
0.24395251
+4

, Scheme :

(define x (+ (exact 183052866407243622723319) (exact .24395251)))
(define y (+ (exact 183052866407243622723319) (exact .0)))

x, , Scheme . :

> x
3297587283763054256749149618043779713285/18014398509481984
> (- x y)
4394657732528389/18014398509481984
> (inexact (- x y))
0.24395251

[edit] . , , ( ).

#e(* 27... 0.6...) - , #e , . (* #e27... #e0.6...).

> (* #e271979577247970257395 #e0.6180339887)
336185245943005654313595042873/2000000000
+4

All Articles