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'm expecting an output of:
(- 1.8305286640724363e+023 (floor 1.8305286640724363e+023)) => .2439521
The expanded scientific notation would give me that answer.
183052866407243622723319.24395251 - 183052866407243622723319.00 = .2439521
I would like to represent these numbers as they are, with the decimal numbers in place, as opposed to scientific notation, so I can achieve the desired result. Is there a way of doing this within Scheme? Any help, guidance, or reference would be much appreciated :)
I am using DrRacket for Windows 64bit and R5RS Language.
EDIT
I figured I'd be as specific as possible regarding an example of thearithmetic I'm performing.
arithmetic:
(* 271979577247970257395 0.6180339887) => 1.6809262297150285e+020
When doing this same multiplication in a calculator, the result yeilds => 168092622971502827156.7975214365
When trying to use exact or inexact I get this:
(exact (* 271979577247970257395 0.6180339887)) => exact: undefined;
(inexact (* 271979577247970257395 0.6180339887)) => inexact: undefined;
I suppose R5RS doesn't support exact/inexact? I looked it up and examples show to use inexact->exact procedure so I did and got this:
(inexact->exact (* 271979577247970257395 0.6180339887)) => 168092622971502854144
And just for specificity, I did the opposite:
(exact->inexact (* 271979577247970257395 0.6180339887)) => 1.6809262297150285e+020
So then I tried using Big Float as someone mentioned:
(bf-precision 128)
(bf (* 271979577247970257395 0.6180339887)) => (bf 168092622971502854144)
Giving me the same output as exact. All I simply want is to save get the number I would get from a calculator and it seems like a very difficult task! I'm sorry I might sound stupid for not getting this, just keep in mind I'm an extreme amateur in SCHEME. Thanks again for your help! :)