Sponsored Content
Full Discussion: Help on Modulus
Top Forums UNIX for Dummies Questions & Answers Help on Modulus Post 302524282 by royalibrahim on Monday 23rd of May 2011 12:01:13 AM
Old 05-23-2011
First set the floating point precision using the bc command's "scale"
Code:
echo "scale=1; 100/200" | bc

# Ans: 0.5
 

3 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help in modulus operator in Bash

Hi, I would like to know given that i have two columns and I would like to take the positive integer of the differences between the two columns. which means |3-2|=1; |2-3|=1 as well. I would like to know do Bash recognize | | as well for this purposes? Thanks. -Jason (2 Replies)
Discussion started by: ahjiefreak
2 Replies

2. Shell Programming and Scripting

Modulus operator

What is the modulus operator in korn shell?? (5 Replies)
Discussion started by: manash.paul
5 Replies

3. Shell Programming and Scripting

awk Division and modulus

I need to read the file divide 3 column with 2nd and run a modulus of 10 and check whether the remainder is zero or not if not print the entire line. cat filename | awk '{ if ($3 / $2 % 10 != 0) print $0}' Whats wrong with it ? (4 Replies)
Discussion started by: dinjo_jo
4 Replies
PROFIL(2)							System Calls Manual							 PROFIL(2)

NAME
profil - execution time profile SYNOPSIS
profil(buff, bufsiz, offset, scale) char *buff; int bufsiz, offset, scale; DESCRIPTION
Buff points to an area of core whose length (in bytes) is given by bufsiz. After this call, the user's program counter (pc) is examined each clock tick (60th second); offset is subtracted from it, and the result multiplied by scale. If the resulting number corresponds to a word inside buff, that word is incremented. The scale is interpreted as an unsigned, fixed-point fraction with binary point at the left: 0177777(8) gives a 1-1 mapping of pc's to words in buff; 077777(8) maps each pair of instruction words together. 02(8) maps all instructions onto the beginning of buff (producing a non-interrupting core clock). Profiling is turned off by giving a scale of 0 or 1. It is rendered ineffective by giving a bufsiz of 0. Profiling is turned off when an exec is executed, but remains on in child and parent both after a fork. Profiling may be turned off if an update in buff would cause a memory fault. SEE ALSO
monitor(3), prof(1) ASSEMBLER
(profil = 44.) sys profil; buff; bufsiz; offset; scale PROFIL(2)
All times are GMT -4. The time now is 09:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy