Page 1 of 1
Round robin calculation for Float
Posted: Fri Jul 07, 2006 1:44 pm
by oryaaaaa
Why doesn't this work?
Code: Select all
Repeat
PokeL(@y.f,x.l)
Debug y ; 0.0 0.0 0.0 0.0 0.0 0.0
; Calculation program
x+1
Until x=0
Thank you
Posted: Fri Jul 07, 2006 1:58 pm
by rsts
What are you expecting?
y never changes and x is never zero?
cheers
Posted: Fri Jul 07, 2006 2:06 pm
by netmaestro
Poking a long into a float? You need to use PokeF(), then it works
Posted: Fri Jul 07, 2006 2:07 pm
by oryaaaaa
Will not you be able to do this from the ActiveBasic user in Japan?
I worry where to be corrected it. Is PureBasic a loser?
Posted: Fri Jul 07, 2006 2:10 pm
by oryaaaaa
I don’t want to put the numerical value in PokeF().
I want to output all numerical values to be able to imagine Float.
Posted: Fri Jul 07, 2006 2:12 pm
by netmaestro
I'm sorry, I can't understand what it is you're trying to do.
Posted: Fri Jul 07, 2006 2:16 pm
by oryaaaaa
Thanks. My writing was bad, sorry.
Posted: Fri Jul 07, 2006 2:20 pm
by b1be
i cant understand either .. but ... why poke?
Code: Select all
Repeat
y.f=x.l ;??
Debug y ; 0.0 0.0 0.0 0.0 0.0 0.0
; Calculation program
x+1
Until x=0
I want to output all numerical values to be able to imagine Float.
you mean to transform a number from long (or any) to float?
Posted: Fri Jul 07, 2006 2:21 pm
by Jan Vooijs
oryaaaaa wrote:Will not you be able to do this from the ActiveBasic user in Japan?
I worry where to be corrected it. Is PureBasic a loser?
Since when is PureBasic a loser??? Blashfamy!! Never is PureBasic a loser, it is a winner!!
I think your translation to english is wrong!!
But an answer is that you can NOT poke a Long as a Float it will not fit (amazing the programs does not crash...
This works (amazingly) you can poke a LONG as a float:
Code: Select all
y.f = 1.0
x.l = 0
Repeat
PokeL(@y.f,x.l)
PokeF(@y.f,x.l)
Debug y ; 0.0 0.0 0.0 0.0 0.0 0.0
CallDebugger
; Calculation program
x+1
Until x=0
End
I presume that PB is making a conversion.
Hope this helps oryaaaaa
Jan V.
[edit]
I think he is writing to memory so he can save a whole region of memory to a file, think games it is an old trick used it myself to 'decode' game settings...
[/edit]
Posted: Fri Jul 07, 2006 3:52 pm
by oryaaaaa
Challenge from ActiveBasic User (It was ordered that write to me. )
I want to give the real number to a specific equation of higher degree and to search for the solution. I want to obtain the combination of all the real numbers input to the Float type. The Long type is the same byte as the Float type, and obtaining all the combinations besides for the Long type : because it is easy.
Memory copy from Long type in Float type (For the unit of bit).
It is possible to translate correctly or I am uneasy.
Thank you
Re: Round robin calculation for Float
Posted: Fri Jul 07, 2006 4:15 pm
by Psychophanta
oryaaaaa wrote:Why doesn't this work?
Code: Select all
Repeat
PokeL(@y.f,x.l)
Debug y ; 0.0 0.0 0.0 0.0 0.0 0.0
; Calculation program
x+1
Until x=0
Thank you
It works perfectly here!
Where is the problem???
EDIT: By the way, what about taking a look at Dioxin's explanation here:
http://www.purebasic.fr/english/viewtopic.php?t=22032
?
Posted: Fri Jul 07, 2006 5:30 pm
by Flype
is something like this you want to do oryaaa ?
Code: Select all
x.l = 12
y.f = 35.456
Debug y
y = x + ( y - Int(y) )
Debug y
Posted: Fri Jul 07, 2006 6:33 pm
by breeze4me
Code: Select all
Repeat
PokeL(@y.f, x)
Debug StrF(y,70)
; Calculation program
x+1
ForEver
works fine.
the problem is that it's very small number, so all digits are not displayed.
result is...
0.0000000000000000000000000000000000000000000000000000000000000000000000
0.0000000000000000000000000000000000000000000014012984643248171000000000
0.0000000000000000000000000000000000000000000028025969286496341000000000
0.0000000000000000000000000000000000000000000042038953929744512000000000
0.0000000000000000000000000000000000000000000056051938572992683000000000
0.0000000000000000000000000000000000000000000070064923216240854000000000
0.0000000000000000000000000000000000000000000084077907859489024000000000
0.0000000000000000000000000000000000000000000098090892502737195000000000
0.0000000000000000000000000000000000000000000112103877145985370000000000
0.0000000000000000000000000000000000000000000126116861789233540000000000
0.0000000000000000000000000000000000000000000140129846432481710000000000
0.0000000000000000000000000000000000000000000154142831075729880000000000
...
Posted: Sat Jul 08, 2006 1:33 pm
by oryaaaaa
Great!!!
I did not think as displayed by the debugger. Thanks
