Sponsored Content
Full Discussion: floating point problem
Top Forums Programming floating point problem Post 302109587 by matrixmadhan on Tuesday 6th of March 2007 11:15:22 PM
Old 03-07-2007
Code:
#include <stdio.h>

int main()
{
  int i;
  float f=1.0;

  for( i=0; i<9; i++, f /= 10 ) {
    printf("%10.8f\n", f);
  }
  return 0;
}

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

problem with floating point numbers in awk

hi all, i have the following problem using awk in a script i want to read the values from a column with real numbers and calculate the mean.the problem is that when i use a statement such as this num = $4 i cant find a way to convert the variable from string to floating point to perform... (7 Replies)
Discussion started by: kanagias
7 Replies

2. Shell Programming and Scripting

floating point addition

hi, :) I have a file like this 10.456 123.567 456.876 234.987 ........ ....... What i want to do is ia have to add all those numbers and put the result in some other file. Any help pls. cheers RRK (8 Replies)
Discussion started by: ravi raj kumar
8 Replies

3. Linux

Floating point exception !!!

Hi, I have linux fedora 4 ver., 2.6 kernal. And qmail & mysql & samba servers are already configured on this server. When I try to install any package like squidguard ,dansguardian,webmin,rsnapshots with command rpm -ivh . It is giving error as “Floating point exception" Snap View is... (3 Replies)
Discussion started by: ssk01
3 Replies

4. Linux

Floating Point Exception

Hi, I am compiling "HelloWorld" C progam on 32-bit CentOS and i want to execute it on 64-bit CentOS architecture. For that i copied the a.out file from 32-bit to 64-bit machine, but while executing a.out file on 64bit machine I am getting "Floating point exception error". But we can run... (3 Replies)
Discussion started by: Mandar123
3 Replies

5. Programming

Floating point Emulator

what is floating point emulator(FPE)? where and why it is used? (1 Reply)
Discussion started by: pgmfourms
1 Replies

6. Shell Programming and Scripting

how to compare 2 floating point no.

Hi, Could any one tell me how to compare to floating point no. using test command. As -eq option works on only intergers. i=5.4 if then echo "equal" else echo "not equal" fi here output will be equal even though no. are unequal. Thanks, ravi (1 Reply)
Discussion started by: useless79
1 Replies

7. Shell Programming and Scripting

floating point numbers in if

# if > then > echo "1" > else > echo "2" > fi -bash: How can i compare floating point numbers inside statement? (15 Replies)
Discussion started by: proactiveaditya
15 Replies

8. Shell Programming and Scripting

floating point number problem

Hello folks I Hope everyone is fine. I am calculating number of bytes calculation from apache web log. awk '{ sum += $10 } END { print sum }' /var/httpd/log/mydomain.log 7.45557e+09 it show above number, what should i do it sow number like 7455, i mean if after decimal point above 5 it... (5 Replies)
Discussion started by: learnbash
5 Replies

9. Shell Programming and Scripting

problem with floating point number loops

Hey, I guess I am just to stupid and am not seeing the "wood for the trees", but I am always getting strange errors. I want to create a mesh with coordinates like: x y z 3.1 3.0 0.75 0 0 1 3.1 2.9 0.75 0 0 1 3.1 2.8 0.75 0 0 1 3.1 2.7 0.75 0 0 1 3.0 ... (10 Replies)
Discussion started by: ergy1983
10 Replies

10. Programming

Floating Point

Anyone help me i cant found the error of floating point if needed, i added the code complete #include <stdio.h> #include <string.h> #include <stdlib.h> #include <ctype.h> typedef struct { int hh; int mm; int ss; char nom; int punt; }cancion; typedef struct... (9 Replies)
Discussion started by: Slasho
9 Replies
GMAGICKDRAW(3)								 1							    GMAGICKDRAW(3)

The GmagickDraw class

INTRODUCTION
CLASS SYNOPSIS
GmagickDraw GmagickDraw Methods o public GmagickDraw GmagickDraw::annotate (float $x, float $y, string $text) o public GmagickDraw GmagickDraw::arc (float $sx, float $sy, float $ex, float $ey, float $sd, float $ed) o public GmagickDraw GmagickDraw::bezier (array $coordinate_array) o public GmagickDraw GmagickDraw::ellipse (float $ox, float $oy, float $rx, float $ry, float $start, float $end) o public void GmagickDraw::getfillcolor (void ) o public float GmagickDraw::getfillopacity (void ) o public string GmagickDraw::getfont (void ) o public float GmagickDraw::getfontsize (void ) o public int GmagickDraw::getfontstyle (void ) o public int GmagickDraw::getfontweight (void ) o public void GmagickDraw::getstrokecolor (void ) o public float GmagickDraw::getstrokeopacity (void ) o public float GmagickDraw::getstrokewidth (void ) o public int GmagickDraw::gettextdecoration (void ) o public string GmagickDraw::gettextencoding (void ) o public GmagickDraw GmagickDraw::line (float $sx, float $sy, float $ex, float $ey) o public GmagickDraw GmagickDraw::point (float $x, float $y) o public GmagickDraw GmagickDraw::polygon (array $coordinates) o public GmagickDraw GmagickDraw::polyline (array $coordinate_array) o public GmagickDraw GmagickDraw::rectangle (float $x1, float $y1, float $x2, float $y2) o public GmagickDraw GmagickDraw::rotate (float $degrees) o public GmagickDraw GmagickDraw::roundrectangle (float $x1, float $y1, float $x2, float $y2, float $rx, float $ry) o public GmagickDraw GmagickDraw::scale (float $x, float $y) o public GmagickDraw GmagickDraw::setfillcolor (string $color) o public GmagickDraw GmagickDraw::setfillopacity (float $fill_opacity) o public GmagickDraw GmagickDraw::setfont (string $font) o public GmagickDraw GmagickDraw::setfontsize (float $pointsize) o public GmagickDraw GmagickDraw::setfontstyle (int $style) o public GmagickDraw GmagickDraw::setfontweight (int $weight) o public GmagickDraw GmagickDraw::setstrokecolor (GmagickPixel $color) o public GmagickDraw GmagickDraw::setstrokeopacity (float $stroke_opacity) o public GmagickDraw GmagickDraw::setstrokewidth (float $width) o public GmagickDraw GmagickDraw::settextdecoration (int $decoration) o public GmagickDraw GmagickDraw::settextencoding (string $encoding) PHP Documentation Group GMAGICKDRAW(3)
All times are GMT -4. The time now is 09:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy