Re: Getting the units of a number
From: Kevin Saff (google.com_at_kevin.saff.net)
Date: 10/23/03
- Next message: Jerry Coffin: "Re: class static variables & __STDC_VERSION__"
- Previous message: BO: "Builder / go to edit filed"
- In reply to: Adrian Gibbons: "Getting the units of a number"
- Next in thread: David Rubin: "Re: Getting the units of a number"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 23 Oct 2003 13:43:47 GMT
"Adrian Gibbons" <adriangibbons@yahoo.co.uk> wrote in message
news:34a2acd5.0310230429.742aed6b@posting.google.com...
> Hello,
>
> I need to get the units of a number.
>
> i.e. if I had 12345 then I would want '5'.
>
> I was looking at dividing the number by ten and using the modulus
> operator repeatedly until I had only the units, but wondered if there
> was an easier way?
You do know that any integer mod 10 is the units part (12345 % 10 == 5)
don't you? Or did you mean the number of digits in the integer?
- Next message: Jerry Coffin: "Re: class static variables & __STDC_VERSION__"
- Previous message: BO: "Builder / go to edit filed"
- In reply to: Adrian Gibbons: "Getting the units of a number"
- Next in thread: David Rubin: "Re: Getting the units of a number"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|