09-27-2017
Quote:
Originally Posted by
Corona688
Okay, you've showed us what you don't want, but I can't tell what you do want. What would a "good" result look like?
Shell does not understand floating point numbers. You'll have to pipe it into bc or awk or some other program/tool/language which does.
There are a lot of syntax errors in your code, also. You can't do X = value you have to do X=value Also there is no INT( ) function in bash. Besides which, functions don't even work that way in bash.
Thank you for the reply. I want to know what is the total number like 1,144,750,000,000,000. I do not know what the right value.. but some thing like that.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Programming
Hi all!
Hi all!
I am working with a problem to find the smallest floating point number that can be represented.
I am going in a loop ,stating with an initial value of 1.0 and then diving it by 10 each time thru the loop.
So the first time I am getting o.1 which I wanted.But from the next... (4 Replies)
Discussion started by: vijlak
4 Replies
3. Programming
Hi,
see the simple code below
double i;
i=8080.9940;
printf(" val :%.30f\n",i);
output i m getting is
val :8080.993999999999700000000000000
when i m expecting
val :8080.9940
what happens?how can i avoid it?
thanks... (2 Replies)
Discussion started by: Hara
2 Replies
4. Linux
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
5. Shell Programming and Scripting
Hi,
I' using bash and I would like to use "bc" to compute the ratio of of two numbers and assign the ratio to a variable.
The numbers are in a file, e.g.
196.304492
615.348986
Any idea how to do it?
N.B. I cannot change the file to have 196.304492 / 615.348986 as the file is produced by... (14 Replies)
Discussion started by: f_o_555
14 Replies
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
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
8. Programming
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
9. Shell Programming and Scripting
Hey again,
I have a basic regex that tests if a number is a float.
Thank you. (5 Replies)
Discussion started by: whyte_rhyno
5 Replies
10. Shell Programming and Scripting
Hello,
I have often found bash to be difficult when it comes to floating point numbers. I have data with rows of tab delimited floating point numbers. I need to find the smallest number in each row that is not 0.0. Numbers can be negative and they do not come in any particular order for a given... (9 Replies)
Discussion started by: LMHmedchem
9 Replies
LEARN ABOUT CENTOS
glgetmaterialfv
GLGETMATERIAL(3G) OpenGL Manual GLGETMATERIAL(3G)
NAME
glGetMaterial - return material parameters
C SPECIFICATION
void glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params);
void glGetMaterialiv(GLenum face, GLenum pname, GLint * params);
PARAMETERS
face
Specifies which of the two materials is being queried. GL_FRONT or GL_BACK are accepted, representing the front and back materials,
respectively.
pname
Specifies the material parameter to return. GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, GL_SHININESS, and GL_COLOR_INDEXES are
accepted.
params
Returns the requested data.
DESCRIPTION
glGetMaterial returns in params the value or values of parameter pname of material face. Six parameters are defined:
GL_AMBIENT
params returns four integer or floating-point values representing the ambient reflectance of the material. Integer values, when
requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable
integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range -1 1, the
corresponding integer return value is undefined. The initial value is (0.2, 0.2, 0.2, 1.0)
GL_DIFFUSE
params returns four integer or floating-point values representing the diffuse reflectance of the material. Integer values, when
requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable
integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range -1 1, the
corresponding integer return value is undefined. The initial value is (0.8, 0.8, 0.8, 1.0).
GL_SPECULAR
params returns four integer or floating-point values representing the specular reflectance of the material. Integer values, when
requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable
integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range -1 1, the
corresponding integer return value is undefined. The initial value is (0, 0, 0, 1).
GL_EMISSION
params returns four integer or floating-point values representing the emitted light intensity of the material. Integer values, when
requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable
integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range -1 1, the
corresponding integer return value is undefined. The initial value is (0, 0, 0, 1).
GL_SHININESS
params returns one integer or floating-point value representing the specular exponent of the material. Integer values, when requested,
are computed by rounding the internal floating-point value to the nearest integer value. The initial value is 0.
GL_COLOR_INDEXES
params returns three integer or floating-point values representing the ambient, diffuse, and specular indices of the material. These
indices are used only for color index lighting. (All the other parameters are used only for RGBA lighting.) Integer values, when
requested, are computed by rounding the internal floating-point values to the nearest integer values.
NOTES
If an error is generated, no change is made to the contents of params.
ERRORS
GL_INVALID_ENUM is generated if face or pname is not an accepted value.
GL_INVALID_OPERATION is generated if glGetMaterial is executed between the execution of glBegin() and the corresponding execution of
glEnd().
SEE ALSO
glMaterial()
COPYRIGHT
Copyright (C) 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see
http://oss.sgi.com/projects/FreeB/.
AUTHORS
opengl.org
opengl.org 06/10/2014 GLGETMATERIAL(3G)