Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added 4 characters in body
Source Link
Rosario
  • 1.7k
  • 5
  • 9

APL(NARS), 92 chars

r←a phi b;e
r←b⋄e←÷10v*⌊⎕FPC÷3.322
b←r⋄a←2÷⍨a+b⋄r←√a×ばつ⍳e<∣r-b
ln←{((2÷⍨⍵+1)phi√⍵)÷⍨⍵-1}

//12+23+31+26= 92 Here I would userewrite the function phi that one can find in the book

ESERCIZI E COMPLEMENTI DI ANALISI MATEMATICA 
VOLUME PRIMO - AUTORE: ENRICO GIUSTI

in the end of "capitolo 3". The same function the Autor says is useful for calculate the function arccos() too.

The problem that I see, is the wrong build of float numeric in computer as the number is in memory the sum of decimal part and fractional part and the dimension in memory of decimal part influence the fractional part and so the precision...

I remember that there is one model in that make float point decimal part, not influence the fractional part as memory space... Is it that the fixed point model?

P is a function for print the number in number of digits that have to be ok if number and its calculus not use numbers with decimal digits > ⎕fpc÷4 in my opinion... (it is as ⎕fpc÷4 is for decimal part and ⎕fpc÷4 is for fractional part , if the memory of decimal part is too much the precision decrease). The numeber that end with the v is the big float.

 P←{⍵⍕⍨⌊⎕fpc÷8}
 ln 0.1
 ̄2.302585093
 P ln 0.1
 ̄2.3025850929940459
 P ln 2
0.6931471805599454
 P ln 99
4.5951198501345889
 ⎕fpc←256
 P ln 99
4.5951198501345889________________
 P ln 99v
4.59511985013458992685243405181018
 ⎕fpc←1024
 P ln 99v
4.59511985013458992685243405181018070911668796958291607868795637640556221035045464682228621763009896899065578402005373000699157761

APL(NARS), 92 chars

r←a phi b;e
r←b⋄e←÷10v*⌊⎕FPC÷3.322
b←r⋄a←2÷⍨a+b⋄r←√a×ばつ⍳e<∣r-b
ln←{((2÷⍨⍵+1)phi√⍵)÷⍨⍵-1}

//12+23+31+26= 92 Here I would use the function phi that one can find in the book

ESERCIZI E COMPLEMENTI DI ANALISI MATEMATICA 
VOLUME PRIMO - AUTORE: ENRICO GIUSTI

in the end of "capitolo 3". The same function the Autor says is useful for calculate the function arccos() too.

The problem that I see, is the wrong build of float numeric in computer as the number is in memory the sum of decimal part and fractional part and the dimension in memory of decimal part influence the fractional part and so the precision...

I remember that there is one model in that make float point decimal part, not influence the fractional part as memory space... Is it that the fixed point model?

P is a function for print the number in number of digits that have to be ok if number and its calculus not use numbers with decimal digits > ⎕fpc÷4 in my opinion... (it is as ⎕fpc÷4 is for decimal part and ⎕fpc÷4 is for fractional part , if the memory of decimal part is too much the precision decrease). The numeber that end with the v is the big float.

 P←{⍵⍕⍨⌊⎕fpc÷8}
 ln 0.1
 ̄2.302585093
 P ln 0.1
 ̄2.3025850929940459
 P ln 2
0.6931471805599454
 P ln 99
4.5951198501345889
 ⎕fpc←256
 P ln 99
4.5951198501345889________________
 P ln 99v
4.59511985013458992685243405181018
 ⎕fpc←1024
 P ln 99v
4.59511985013458992685243405181018070911668796958291607868795637640556221035045464682228621763009896899065578402005373000699157761

APL(NARS), 92 chars

r←a phi b;e
r←b⋄e←÷10v*⌊⎕FPC÷3.322
b←r⋄a←2÷⍨a+b⋄r←√a×ばつ⍳e<∣r-b
ln←{((2÷⍨⍵+1)phi√⍵)÷⍨⍵-1}

//12+23+31+26= 92 Here I would rewrite the function phi that one can find in the book

ESERCIZI E COMPLEMENTI DI ANALISI MATEMATICA 
VOLUME PRIMO - AUTORE: ENRICO GIUSTI

in the end of "capitolo 3". The same function the Autor says is useful for calculate the function arccos() too.

The problem that I see, is the wrong build of float numeric in computer as the number is in memory the sum of decimal part and fractional part and the dimension in memory of decimal part influence the fractional part and so the precision...

I remember that there is one model in that make float point decimal part, not influence the fractional part as memory space... Is it that the fixed point model?

P is a function for print the number in number of digits that have to be ok if number and its calculus not use numbers with decimal digits > ⎕fpc÷4 in my opinion... (it is as ⎕fpc÷4 is for decimal part and ⎕fpc÷4 is for fractional part , if the memory of decimal part is too much the precision decrease). The numeber that end with the v is the big float.

 P←{⍵⍕⍨⌊⎕fpc÷8}
 ln 0.1
 ̄2.302585093
 P ln 0.1
 ̄2.3025850929940459
 P ln 2
0.6931471805599454
 P ln 99
4.5951198501345889
 ⎕fpc←256
 P ln 99
4.5951198501345889________________
 P ln 99v
4.59511985013458992685243405181018
 ⎕fpc←1024
 P ln 99v
4.59511985013458992685243405181018070911668796958291607868795637640556221035045464682228621763009896899065578402005373000699157761
Source Link
Rosario
  • 1.7k
  • 5
  • 9

APL(NARS), 92 chars

r←a phi b;e
r←b⋄e←÷10v*⌊⎕FPC÷3.322
b←r⋄a←2÷⍨a+b⋄r←√a×ばつ⍳e<∣r-b
ln←{((2÷⍨⍵+1)phi√⍵)÷⍨⍵-1}

//12+23+31+26= 92 Here I would use the function phi that one can find in the book

ESERCIZI E COMPLEMENTI DI ANALISI MATEMATICA 
VOLUME PRIMO - AUTORE: ENRICO GIUSTI

in the end of "capitolo 3". The same function the Autor says is useful for calculate the function arccos() too.

The problem that I see, is the wrong build of float numeric in computer as the number is in memory the sum of decimal part and fractional part and the dimension in memory of decimal part influence the fractional part and so the precision...

I remember that there is one model in that make float point decimal part, not influence the fractional part as memory space... Is it that the fixed point model?

P is a function for print the number in number of digits that have to be ok if number and its calculus not use numbers with decimal digits > ⎕fpc÷4 in my opinion... (it is as ⎕fpc÷4 is for decimal part and ⎕fpc÷4 is for fractional part , if the memory of decimal part is too much the precision decrease). The numeber that end with the v is the big float.

 P←{⍵⍕⍨⌊⎕fpc÷8}
 ln 0.1
 ̄2.302585093
 P ln 0.1
 ̄2.3025850929940459
 P ln 2
0.6931471805599454
 P ln 99
4.5951198501345889
 ⎕fpc←256
 P ln 99
4.5951198501345889________________
 P ln 99v
4.59511985013458992685243405181018
 ⎕fpc←1024
 P ln 99v
4.59511985013458992685243405181018070911668796958291607868795637640556221035045464682228621763009896899065578402005373000699157761

AltStyle によって変換されたページ (->オリジナル) /