Hello
I had a similar issue years ago when experimenting with 2d lines and slope values. IanM pointed me in the right direction.
NAN's are just invalid floating point values which can't be stored in the number of bits allocated to the variables storing them.
There are variations on NAN, QNAN "Quiet Not A Number", SNAN "Signalling Not A Number", something to do with NAN significant bits being set or not set. But they are all NAN. Google has loads on this topic!
Anyway, here's a snippet showing how to represent NAN and INF in DBPro (I still owe IanM a virtual pint for these!

)
Global NAN as Float
Global INF as Float
Make Memblock 1, 4
Write Memblock Dword 1, 0, 0x7F800000
INF = Memblock Float(1, 0)
Write Memblock Dword 1, 0, 0x7F800001
NAN = Memblock Float(1, 0)
Delete Memblock 1
Cls
Print NAN
Print INF
Wait Key
End
Regarding your snippets, what values are used for acceleration and deceleration?
It would seem that the "PROP_thrust_acceleration" are setting "PROP_thrust_speed" to values which are out of floating point range. I would guess that the acceleration values are problematic, particularly the deceleration ones. Try changing those.
Additionally, maybe implement minimum/maximam ranges on acceleration/deceleration values. They can then be checked if they go too high or too low and contained with valid ranges.
Alternatively, if you need the finer resolution, try changing the "ship_details().PROP_" variables to Double Floats instead. It's more of a hack than a fix as you can still get NAN or INF with Double Floats but might improve things a little.
All the best.