Post Reply 
HP Prime: Black Hole Characteristics – Hawking Radiation
01-20-2018, 12:23 PM
Post: #3
RE: HP Prime: Black Hole Characteristics – Hawking Radiation
(01-05-2018 03:32 AM)Eddie W. Shore Wrote:  HP Prime: Black Hole Characteristics – Hawking Radiation

<...>
HP Prime Program BLACKHOLE

Code:
EXPORT BLACKHOLE()
BEGIN
// EWS 2018-01-04
// Hawking Radiation

// Input of mass
LOCAL ch,M;
INPUT({M,{ch,{"kg","Solar Mass"}}},
"Mass",{"Mass: ","Unit: "});

IF ch:=2 THEN
M:=1.988435ᴇ30*M;

<...>
<...>
http://xaonon.dyndns.org/hawking/ Retrieved December 26, 2017

Hello,

nice program - had to try it immediately with my brand new HP Prime Smile

Yet - it has a small error: If you try to change the input units to [kg], instead of [solar masses], the the check goes wrong:
Code:
IF ch:=2 THEN

should read

Code:
IF ch=2 THEN

With this small change it works nicely and delivers good results. The bug is in IF ch:=2, this sets ch to 2, instead of comparing it.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP Prime: Black Hole Characteristics – Hawking Radiation - hfw - 01-20-2018 12:23 PM



User(s) browsing this thread: 1 Guest(s)