Calculate e raise to the power in awk | UNIX


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Calculate e raise to the power in awk | UNIX
Prev   Next
# 3  
Old 11-15-2019
Assuming your formula is correct, checked longhand in Python 3.8.0 using the math library:
Code:
Last login: Fri Nov 15 17:16:16 on ttys000
AMIGA:amiga~> python3.8
Python 3.8.0rc1 (v3.8.0rc1:34214de6ab, Oct  1 2019, 12:56:49) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> 
>>> math.exp((0.5-0.013)*0.5)/(1.0+math.exp((0.5-0.013)*0.5))
0.5605759881403045
>>> math.exp((0.5-0.01125)*0.5)/(1.0+math.exp((0.5-0.01125)*0.5))
0.5607915159336736
>>> math.exp((0.5-0.3581)*0.5)/(1.0+math.exp((0.5-0.3581)*0.5))
0.5177300630065548
>>> math.exp((1.0-0.005268)*25)/(1.0+math.exp((1.0-0.005268)*25))
0.9999999999841571
>>> _

So your rounded values seem OK.
Again this assumes that your formula is correct.
This User Gave Thanks to wisecracker For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

[Solved] To the power of using awk

Hi Guys, I got stuck to a a point where I need to find the value for (4 to the power of -2 upto 8 places after decimal .... 4^(-2) ; the result I need is upto 8 places after decimal. How is that possible? Thanks a lot!! (2 Replies)
Discussion started by: Indra2011
2 Replies

2. UNIX for Advanced & Expert Users

Unix user with root power problem in to login in putty

Hello, I created a user in my AIX 5.3 system and i modified /etc/passwd file in and assigned this user the uid=0 like root user. The problem is that when this user log into the system through putty it asks for root password instead of the user password. As a result of this, if i reset the... (4 Replies)
Discussion started by: omonoiatis9
4 Replies

3. Shell Programming and Scripting

Calculate Average AWK

I want to calculate the average line by line of some files with several lines on them, the files are identical, just want to average the 3rd columns of those files.:wall: Example file: File 1 001 0.046 0.667267 001 0.047 0.672028 001 0.048 0.656025 001 0.049 ... (2 Replies)
Discussion started by: AriasFco
2 Replies

4. Shell Programming and Scripting

Calculate P Value -Awk

Is there any awk command to calculate P Value ?(Probability) Is it possib;e to calculate P va;ue for this data for ex? 7.891284 8.148193 7.749575 7.958188 7.887702 7.714877 8.141548 7.51845 8.27736 7.929853 7.92456 8.249126 7.989113 8.012573 8.351206 (2 Replies)
Discussion started by: stateperl
2 Replies

5. Shell Programming and Scripting

raise an alarm in Unix

Hi members, I am working in WebSphere in Unix environment. we are working with 500 odd servers and most of the times processes got down. Can i have any shell script through whih some popup with alarm get raised whenever some server get down. kindly help.. Thanks Rishi (1 Reply)
Discussion started by: rishi.madan
1 Replies

6. Shell Programming and Scripting

how can i calculate a file using awk

hi all Am new to scripting... So,i have a file named file1 its contents are as follows: joy 55 66 77 ruby 77 88 99 saloni 88 44 33 I would require a script which will calculate its percentage,its total and the average with awk script Many thanks in advance.. Please reply me at... (4 Replies)
Discussion started by: whizkidash
4 Replies

7. Shell Programming and Scripting

How to calculate with awk

Hi, I have below awk statement and I need to convert the second field ( substr($0,8,6))from minutes to hours with 2 decimail place. How can I achieve this? /usr/bin/awk '{print substr($0,23,4),substr($0,8,6)}' /tmp/MANAGER_LIST.$$ >> /tmp/NEWMANAGER_LIST.$$ Thanks for any help! (4 Replies)
Discussion started by: whatisthis
4 Replies
Login or Register to Ask a Question
Finance::Quote::Fidelity(3)				User Contributed Perl Documentation			       Finance::Quote::Fidelity(3)

NAME
Finance::Quote::Fidelity - Obtain information from Fidelity Investments. NOTE NOTE NOTE NOTE NOTE
This module is currently non-functional. SYNOPSIS
use Finance::Quote; $q = Finance::Quote->new; %info = Finance::Quote->fetch("fidelity","FBGRX"); %info = Finance::Quote->fetch("fidelity_direct","FBGRX"); DESCRIPTION
This module obtains information from Fidelity Investments, http://www.fidelity.com/. This module is loaded by default on the Finance::Quote object. It is also possible to load this module explicitly by passing "Fidelity" as one of Finance::Quote->new()'s parameters. The "fidelity" fetch method may make use of failover modules. The "fidelity_direct" method will only obtain information directly from Fidelity. Information returned by this module is governed by Fidelity Investment's terms and conditions. LABELS RETURNED
The following labels may be returned by Finance::Quote::Fidelity: exchange, name, number, nav, change, ask, date, yield, price. SEE ALSO
Fidelity Investments, http://www.fidelity.com/ Finance::Quote::Yahoo::USA; perl v5.12.1 2009-10-05 Finance::Quote::Fidelity(3)