11-06-2018
Your use of printf "%f" is perhaps begging for trouble, that may convert to floating point and back. And even 64-bit floating point doesn't have the exactness of a 64-bit integer, some of those 64 bits get dedicated to mantissa et cetera.
dash gives +224466891.896745235 on my system, bash and ksh give +224466891.896745230, and zsh doesn't work at all, it gives "invalid floating point number" on printf "%s%.9f\n" "$MINUS" "$RESULT"
Last edited by Corona688; 11-06-2018 at 11:31 AM..
7 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Anyone know of a guide or instructions for Solaris
I got to configure a SBUS HBA to talk to a tape robot.
I have done this on a switch but not point to point.
just going HBA >>>>> TAPE Fibre simple two nodes
Kie (6 Replies)
Discussion started by: kie
6 Replies
2. UNIX for Dummies Questions & Answers
Hi!
I'm new in these forums and more or less new with Unix. So... here is the question:
does anyone know where is redirected the output of a command when you put >&- after it?
Does it means any standard file descriptor?
Thanks! (2 Replies)
Discussion started by: csecnarf
2 Replies
3. Shell Programming and Scripting
hi,
I would like to ask or is it possible to dump a hex using dd from starting point to end point just like the "xxd -s 512 -l 512 <bin file>"
I know the redirect hexdump -C but i can't figure it out the combination options of dd.
Hope someone can share their knowledge..
Thanks in... (3 Replies)
Discussion started by: jao_madn
3 Replies
4. Post Here to Contact Site Administrators and Moderators
HI Everyone,
I have below source file
AAA|NAME1|ADDRESS1|300.20
BBB|NAME2|ADDRESS2|400.31
CCC|NAME3|ADDRESS3|300.34
I have requirement where I need to sum up fourth field in above fixed width pipe delimited flat file. When I use below code, it gives me value 1001.00
But I am expecting... (1 Reply)
Discussion started by: patricjemmy6
1 Replies
5. Shell Programming and Scripting
Hey all! :)
I'm trying to create a fixed mount point for an usb cardreader.
I've found a script on a raspberry pi forum which does the following:
usb stick is plugged in -> script checks the mount point for data -> script starts copying the files automatically -> script unmounts the... (0 Replies)
Discussion started by: Eomer
0 Replies
6. UNIX for Beginners Questions & Answers
How to create a new mount point with 600GB and add 350 GBexisting mount point
Best if there step that i can follow or execute before i mount or add diskspace IN AIX
Thanks (2 Replies)
Discussion started by: Thilagarajan
2 Replies
7. Shell Programming and Scripting
Well, guys I saw a question about GOTO for Python.
So this gave me the inspiration to attempt a GOTO function for 'dash', (bash and ksh too).
Machine: MBP OSX 10.14.3, default bash terminal, calling '#!/usr/local/bin/dash'...
This is purely a fun project to see if it is possible in PURE... (3 Replies)
Discussion started by: wisecracker
3 Replies
values.h(3HEAD) Headers values.h(3HEAD)
NAME
values.h, values - machine-dependent values
SYNOPSIS
#include <values.h>
DESCRIPTION
This file contains a set of manifest constants, conditionally defined for particular processor architectures.
The model assumed for integers is binary representation (one's or two's complement), where the sign is represented by the value of the
high-order bit.
BITS(type) The number of bits in a specified type (for example, int).
HIBITS The value of a short integer with only the high-order bit set.
HIBITL The value of a long integer with only the high-order bit set.
HIBITI The value of a regular integer with only the high-order bit set.
MAXSHORT The maximum value of a signed short integer.
MAXLONG The maximum value of a signed long integer.
MAXINT The maximum value of a signed regular integer.
MAXFLOAT, LN_MAXFLOAT The maximum value of a single-precision floating-point number, and its natural logarithm.
MAXDOUBLE, LN_MAXDOUBLE The maximum value of a double-precision floating-point number, and its natural logarithm.
MINFLOAT, LN_MINFLOAT The minimum positive value of a single-precision floating-point number, and its natural logarithm.
MINDOUBLE, LN_MINDOUBLE The minimum positive value of a double-precision floating-point number, and its natural logarithm.
FSIGNIF The number of significant bits in the mantissa of a single-precision floating-point number.
DSIGNIF The number of significant bits in the mantissa of a double-precision floating-point number.
SEE ALSO
intro(3) math.h(3HEAD)
SunOS 5.10 2 Mar 1993 values.h(3HEAD)