Ok, i'll try to give a simple explanation. I was drawing a graph with GD::Graph and would like to restrict the the y-ticks so they only get drawn on values like these: 1, 1.5, 2, 2.5, etc. The number of ticks was pre-set.
I've since gone another way that dispenses with this completely, but still thought it would be something nice to meditate over, especially as i couldn't find a solution that didn't fall afoul any of these:
- shooting with cannons at flies
- incredibly hackish
- requires a lot of code
- comes with a lot of situations where it fails
I was hoping i'd missed something and someone would point out some inbuilt "has_decimal" function in Perl or something, but apparently no such thing exists.