Article 6NYHQ [SOLVED] calculating lists of dollar amounts (off by a few pennys) ?

[SOLVED] calculating lists of dollar amounts (off by a few pennys) ?

by
schneidz
from LinuxQuestions.org on (#6NYHQ)
ennee way ken get this code to act rite ?:Code:schneidz@lq> cat s.c
#include <stdio.h>

main()
{
int i;
float s = 4.18;

i = s * 100;
printf("float s = %f :: int i (s x 100) = %d\n", s, i);
}
schneidz@lq> a.out
float s = 4.180000 :: int i (s x 100) = 417
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments