Sponsored Content
Top Forums Programming Find out 2^n+1 , where n is a 3 digit number Post 302443587 by jim mcnamara on Monday 9th of August 2010 11:07:08 AM
Old 08-09-2010
<conio.h>: It looks like Turbo C 3.0; long int is 32 bit. There is no bignum library for it.
You already have seen the problem with double precision arithmetic and large numbers.

You need a different compiler.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting 10 digit number from txt files

Hi, Was wondering if you could give me an example of extracting a 10 digit number from 5 txt files using a regular expression (the number is always different ) and storing the numbers in variables Thanks C19 (9 Replies)
Discussion started by: c19h28O2
9 Replies

2. Shell Programming and Scripting

Write a shell program to find the sum of alternate digits in a given 5-digit number

Hi Can any one please post the answer for the above program.................. (4 Replies)
Discussion started by: banta
4 Replies

3. Shell Programming and Scripting

adding a 6 digit number retaining 0s on the left

i am new to shell scripting. i want to keep on increamenting a 6 digit number. For eg. 000000 + 1 = 000001 But instead of 000001 i get only 1. How do i do this ? Pls help. (8 Replies)
Discussion started by: kanchan_cp
8 Replies

4. Programming

generating 16 digit random number in C

Hi, How can we generate 16 digit random nos in C. (10 Replies)
Discussion started by: ajaysahoo
10 Replies

5. UNIX for Dummies Questions & Answers

list all files containing 4 digit number using grep

how can i list all files in my home directory that have a 4 digit id number, the line number where the id is located and the id itself not printing the entire line? (5 Replies)
Discussion started by: hobiwhenuknowme
5 Replies

6. Shell Programming and Scripting

Print a number up to last significant digit after decimal point

I want to write/print a number through a shell script up to its last significant digit (LSD) after the decimal point. Say, x=10.00056000000000000 I want to print x as x=10.00056. Note that x can be any thing so I cannot know the position of the LSD always. Thanks. (16 Replies)
Discussion started by: hbar
16 Replies

7. Shell Programming and Scripting

Regular expression for 6 digit number present in a line

Hello Team, i have a file test1.txt, in which i have to grep only the 6 digit number from it, Could you pls help in this. $cat test1.txt <description>R_XYZ_1.6 r370956</description> $ grep "\{6\}" test1.txt <description>R_XYZ_1.6 r370956</description> i need output as 370956. ... (3 Replies)
Discussion started by: chandana hs
3 Replies

8. Shell Programming and Scripting

How to compare specific digit in number?

Dear All, Lets say I have a number with following format: ####.12e-## now I want to compare place holder in position 1 and 2. How can I do that? Note: My number is stored in a variable say var. example: var=9999.12e-05 Thanks & Regards, linuxUser_ (6 Replies)
Discussion started by: linuxUser_
6 Replies

9. UNIX for Beginners Questions & Answers

Process only 4 digit odd number starting with zero

I am trying to process only IonCode_odd #'s (always 4 digits starting with zero), but the below isn't working as expected. Is there a better way? Thank you :). IonCode_0401_xxxx_xxxx_xxxx.bam IonCode_0401_xxxx_xxxx_xxxx.bam.bai IonCode_0401_xxxx_xxxx_xxxx.fastq... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. UNIX for Beginners Questions & Answers

I need to find in a file a list of number where last two digit end in a range

I all I am tryng to find a way to sort a list of number in a file by the value of last two digit. i have a list like this 313202320388 333202171199 373202164587 393202143736 323202132208 353201918107 343201887399 363201810249 333201805043 353201791691 (7 Replies)
Discussion started by: rattoeur
7 Replies
CheckDigits::MBase_002(3pm)				User Contributed Perl Documentation			       CheckDigits::MBase_002(3pm)

NAME
CheckDigits::MBase_002 - compute check digits for blood bags (DE), BZUe (DE), VAT Registration Number (DE) SYNOPSIS
use Algorithm::CheckDigits; $bb = CheckDigits('blutbeutel'); if ($bb->is_valid('2761011234567893')) { # do something } $cn = $bb->complete('276101123456789'); # $cn = '2761011234567893' $cd = $bb->checkdigit('2761011234567893'); # $cd = '3' $bn = $bb->basenumber('2761011234567893'); # $bn = '276101123456789'; DESCRIPTION
ALGORITHM 1. Start with values P = 10, S = 0. 2. Beginning left you do the following for all digits 1. S = (P + digit) modulo 10 2. If S is 0 then S = 10. 3. P = (2 * S) modulo 11 3. The check digit is (11 - P) modulo 10. METHODS is_valid($number) Returns true only if $number consists solely of numbers and the last digit is a valid check digit according to the algorithm given above. Returns false otherwise, complete($number) The check digit for $number is computed and concatenated to the end of $number. Returns the complete number with check digit or '' if $number does not consist solely of digits and spaces. basenumber($number) Returns the basenumber of $number if $number has a valid check digit. Return '' otherwise. checkdigit($number) Returns the checkdigit of $number if $number has a valid check digit. Return '' otherwise. EXPORT None by default. AUTHOR
Mathias Weidner, <mathias@weidner.in-bad-schmiedeberg.de> SEE ALSO
perl, CheckDigits, www.pruefziffernberechnung.de, www.eurocode.org. perl v5.10.0 2008-05-17 CheckDigits::MBase_002(3pm)
All times are GMT -4. The time now is 08:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy