Getting the units of a number

From: Adrian Gibbons (adriangibbons_at_yahoo.co.uk)
Date: 10/23/03


Date: 23 Oct 2003 05:29:49 -0700

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?

Regards,

Adrian.



Relevant Pages

  • Re: Promotion of HD TVs in high street stores
    ... dividing SD from HD. ... My impression was the SD had been fiddled with to make it lack quality. ... Regards ...
    (uk.tech.digital-tv)
  • Re: Promotion of HD TVs in high street stores
    ... dividing SD from HD. ... My impression was the SD had been fiddled with to make it lack quality. ... Regards ...
    (uk.tech.digital-tv)
  • Re: fft phase for object detection
    ... dividing each value by its modulus (thus removing ... coefficients from polar back to Cartesian form, ...
    (sci.image.processing)
  • Re: Kingdom Of Heaven
    ... The response to this music is a curiosity. ... There seems to be a dividing ... line in regards to this score. ... People either love it or hate it. ...
    (rec.music.movies)
  • Re: help solving addition problem in C
    ... take a temporary variable to store sum and initialize it to zero, ... Now by recursively taking modulus and dividing the number you can each ...
    (comp.lang.c)