Getting value behind decimal point

classic Classic list List threaded Threaded
2 messages Options
ZWD
Reply | Threaded
Open this post in threaded view
|

Getting value behind decimal point

ZWD
Hi there,

I need to get the value behind the decimal point.

example:   12/5 = 2,4
now I want to get the value 0,4 in e.g. a
so  a = 0,4

I looked around but all i could find is that u need a 'long' for more values behind the decimal point.

Thanks

ZWD
Reply | Threaded
Open this post in threaded view
|

Re: Getting value behind decimal point

Sebastian Schubert-2
Hi,

On Mittwoch 18 August 2010 16:51:31 ZWD wrote:
> Hi there,
>
> I need to get the value behind the decimal point.
>
> example:   12/5 = 2,4
> now I want to get the value 0,4 in e.g. a
> so  a = 0,4

a = mod(12/5,1)

Sebastian

_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

signature.asc (205 bytes) Download Attachment