I have to write a c program which takes a 3 digit number n and calculates the value of (2^n)+1 and then determines the number is prime or not.
I have tried to first calculate the value of 2^n and then adding one to it and then apply the logic of prime number.
but the ultimate problem is that if n is a 3 digit number for example 100
then 2^100 becomes a huge number for which my program is returning the same value of 2^100 and 2^100+1
for 2^50 and 2^50+1 it returns correct values with the diff of 1.
Please help me out here.
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT OSX
io::digest
IO::Digest(3) User Contributed Perl Documentation IO::Digest(3)NAME
IO::Digest - Calculate digests while reading or writing
SYNOPSIS
use IO::Digest;
# Get a Digest::MD5 object that takes input while $fh being written or read
$iod = IO::Digest->new ($fh, 'MD5');
print $fh "fooo";
print $iod->hexdigest
DESCRIPTION
This module allows you to calculate digests while reading or writing file handles. This avoids the case you need to reread the same
content to compute the digests after written a file.
TEST COVERAGE ----------------------------------- ------ ------ ------ ------ ------ ------
File stmt branch cond sub time total
----------------------------------- ------ ------ ------ ------ ------ ------
blib/lib/IO/Digest.pm 100.0 n/a n/a 100.0 100.0 100.0
Total 100.0 n/a n/a 100.0 100.0 100.0
----------------------------------- ------ ------ ------ ------ ------ ------
AUTHORS
Chia-liang Kao <clkao@clkao.org>
COPYRIGHT
Copyright 2004 by Chia-liang Kao <clkao@clkao.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <http://www.perl.com/perl/misc/Artistic.html>
perl v5.16.2 2004-09-11 IO::Digest(3)