Making a loop that will stop when a double or a float will max out

Can someone tell me to how I can create a loop that will take a float abd a double value each with a beginning value of 2 and double each value until both variables run out of memory, and return the maximum valid value for each variable? I assume I will need two loops to do this, but I am not sure how to get the loop to stop. I have had the values go into crazy negative numbers when it starts to max out.

So it does. Apparently that example only works for fixed point math... I did
System.out.println(Double.MAX_VALUE * 2);and it said "Infinity" which I find a little humorous. In any case, try the static methods Float.isInifinite() and Double.isInfinite()
EDIT: even weirder!
public static final double POSITIVE_INFINITY = 1.0 / 0.0;

Similar Messages

  • I am trying to create an executable vi that will call out another vi and show its front panel in the executable​. When I try this I recieve this error message "top level vi (my main vi) was stopped at unknown on the block diagram of (my sub vi)

    I am trying to create an executable vi that will call out another vi and show its front panel in the executable.  When I try this I recieve this error message "top level vi (my main vi) was stopped at unknown on the block diagram of (my sub vi)

    Well the most common way is to enclude the vi's in the build spec either directly in the dependancies that the App builder automatically generates OR by declaring them in the build spec as "additional enclusions" (like you must do for dynamic vi calls in your app.
    I have heard rummors about My.app Stuff.vi in a nugget Intaris posted- and I've wanted to dig deaper into Intaris' claims- but have not tried it myself.
    If you go down the stuff.vi route Keep us curious guys posted
    Jeff

  • Making a DVD that will play on windows XP

    Hello,
    I am trying to make a DVD for a client that will play on a Mac, a regular DVD player, and on a PC. The DVD will also have PDF's to access. I have given instructions to open the PDF's because I didn't want to mess with DVD@ccess.
    So far the DVD plays well on everything, even Windows Vista, but will not play on my clients computer. She is using Windows XP. She plans on making about 5000 copies, but is concerned that some people will have the problem that she is having.
    Is there something I can do to make it play on her computer?
    Are the PDF's messing things up?
    If she takes my DVD to a big time production house to duplicate, will that clear up the issue?
    I feel like I might lose her soon, and she has about 80 more jobs for me. I don't know what to do!
    Thanks for any help you might offer. I'm going crazy!
    Chris Walsh

    Chris Walsh1 wrote:
    So far the DVD plays well on everything, even Windows Vista, but will not play on my clients computer. She is using Windows XP. She plans on making about 5000 copies, but is concerned that some people will have the problem that she is having.
    Windows computers do have a lot of "issues". The first thing you can do is make sure she is using a DVD player other than Windows Media Player (the absolute worst). PowerDVD, WinDVD, etc all have better chances of playing DVDs. Remember to use simple logic. If it plays on Macs, it plays on Vista, it plays on stand alone DVD players, and it plays on other Windows XP computers (it does, trust me) but it doesn't play on her computer… there must be something wrong with her computer.
    Is there something I can do to make it play on her computer?
    No, because the DVD isn't the problem, it's the client's computer that is the problem. Now, Windows Media Player is notorious for having problems with DVD-R and DVD+R discs. Sending it out for replication to DVD 5 discs might allow her to play the DVD… but there are no guarantees, she could be having a whole host of other problems.
    You do realize that even if you do get it to work on her computer, you are guaranteed to get somebody using Windows saying, "It doesn't play." And the reason could be that they only have a CD drive… There is no "foolproof" solution.

  • How do I change the loop that is running when an event happens?

    Hello,
       I've written a program that does a linear temperature ramp on sample substrates under UHV. Right now, the program just ramps the current of a power supply(which heats the sample by radiative heating), reads the temperature from a thermocouple, and using a feedback formula adjust the current accordingly so that the ramp stays linear. All of this is done in a while loop.  I now need the program to be able to ramp to a certain temperature, and hold at that temperature for a time period.  I already have the feedback formula written in order to do this, but how do I tell my program to use my new loop once the old loop reaches a certain temperature? I was thinking maybe an event structure, but still not sure on how to use it.  Your help is greatly appreciated, thank you. 

    You need a state machine (or action engine). You can create one, from the Labview templates.
    see here
    An easier way is to stop the loop and continiou with a new loop. Of cource this option is "one way". 
    Attachments:
    Example_VI_BD.png ‏2 KB

  • Making a login that will direct to a file/url based on unique id

    This may be the wrong forum, and I apologize if so.... I have a flash website for my photography business and I would like to make a link I have to "Client Photos" redirect to a specific clients files/folder with thier unique id and/or password. Currently I send them to another URL alltogether where I have my shopping cart set up and hosted, but they see a long list of folders/thumbnails and have to click on thiers then enter a password. This is set up thru zenfolio so I didnt have to do any coding for the password. I already have the link on my flash site, I am just wondering if someone can point me to a good tutorial on php/mysql (i assume this is the best method as a database will be required) that addresses this without having to spend 6 months becoming a php expert first. I am pretty familiar with dreamweaver CS3 and have built dozens of html/css static sites, some javascript stuff, but this level of interactivity is all new to me.
    Basically this is the flow needed:
    1. Client clicks link on flash site, and is taken to a login page (would like to use an xhtml/css page for this instead of flash because many clients use iphones, so i can give them all the same url to login page also, bypassing flash site they cant see if on a mobile device)
    2.this page will be styled like my site so its seamless looking and will have two form fields so client can enter thier last name as a login and a password I assign
    3. when this data is entered the database (i assume) will have a url stored that is a gallery of thier images and open this in a new browser tab/ window
    I am a complete newb at this sort of thing and want to learn instead of just being handed code, so ANY help is greatly appreciated. Most photographers websites I see have a feature like this so I assume its not an uncommon thing, however when I ask other photographer friends how they did it, none of them have a clue because they paid someone else to build thier site or it was already included in a template...

    You're in the right forum now. I have moved this thread to the Dreamweaver Application Development forum, which deals with PHP/MySQL and other server-side issues.
    What you want to achieve is relatively simple with Dreamweaver's User Authentication server behaviors. The Dreamweaver help files have a section on Building a login page. There's also a tutorial in the Adobe Developer Connection on setting up a PHP testing environment.
    Out of the box, the Dreamweaver login system sends everyone to the same page, but it's relatively easy to tweak the code to send people to individual pages. You can ask here for more help once you've got the basic system set up. You might also find my book "The Essential Guide to Dreamweaver CS4 with CSS, Ajax, and PHP" smooths out a lot of the process for you. It has a complete chapter on building a user login system, including the database end. It also shows how to redirect users to individual pages.

  • Making a Thread that can stop itself

    I made a Thread this way;
    new Thread(new Runnable(){
    public void run(){
    }).start();
    how can I get this Thread to stop itself???

    What happens when an unstoppable thread hits an unmoveable block of code?I'd like to see that tested experementally at CERN :-)

  • My iMac is making a louder that usual sound when in use - any suggestions to get it to chill out a bit?!

    It's a low whirring, I'm sure it's louder than it used to be and it definitely gets louder the more windows I have open, or applications are running, iTunes with Photoshop and Safari etc. causes it to get much louder. It's not the actual fan as far as I can tell, the other day I put it to sleep and it instead froze and the fan was really loud in that case and I just had to turn it off at the back.
    I tried repairing the disk permissions, it's made no difference. I can't see anything out of place it Activity Monitor but I might be wrong about that.
    Is it a case of the Mac getting too hot, or just that it's nearly 6 years old?!
    Any suggestions would be great, thanks.

    First, make sure that all your air vents are free of dust and lint.
    Then,try http://support.apple.com/kb/HT1436 Resetting SMU
    After that, if you do not have an iSight, open the back and look for bulging or leaking caps (the little soda can).  It's likely that either some caps are bad or your power supply unit is failing.  Go to User>Applications>Utilities>Console and type in maximum temperature in the little box at the top right of Console.  If you see any heat messages, then your problem is likely what I suggested.    

  • Making a control that will display every 4th digit - how?

    how can i make a control which will only enable the user to insert every 4th digit? (4, 8, 12.. etc)

    Here's one way:
    and if you're overly pedantic about 0, you can also do this:
    Attachments:
    FormatConditions_BD.png ‏12 KB
    Example2_VI_BD.png ‏13 KB

  • Looking for a app that will go out and get all my credit card balances.

    I am looking for a App that can go on all the web sites for my Credit Cards and download the balance Interest Rate Payment.....
    Anyone know of a good one?

    I recommend that instead of working on an iPad application you get a good web programmer in and set up a web-facing system that can be used from anything with a web browser --  an iPad, a smartphone, a laptop or a desktop.  Then your employees can access the system from any computer with a web browser, and you don't need to employ an expensive specialist programmer to produce a system which is useless for devices made by other manufacturers.  The only requirement for use will be that your devices must in range of either WiFi or a phone signal.
    It will also mean that if you need to change your software at any time you only have to change one copy, back at headquarters, rather than update an App on every individual iPad.
    Apple's web browsers (including the ones built into iDevices) allow a web site to request the user's location, so people using an iPad should be able to do the things you have asked for.

  • I am a teacher and I want a formula for Numbers that will average out A, B, C, D and E's of my students.

    As the title says- I'm not much of a formula wizard and any help would be appreciated. Here's an example-
    Student A receives a B, C, A, A, D, A for 6 assignments. I want them to average out at the end of the row, as well as an average on a separate page of summaries for all subjects that are assessed this way.
    Ive seen it on an excel spreadsheet but was unable to look at the formula.
    Please help as the semester starts in a week for us in Australia!
    Thanks

    ellroy wrote:
    I basically want a formula where I can average Letters out to a B- or C+. Can I do this from just letters alone or do I need to assign numbers. Speaking to my curriculum coordinator, she said stick to LETTERS and see if we can sort out something for that as we don't officially report in numbers.
    So that would mean I would need an average formula that would calculate B + C + C + D + A into a single Letter. I dont know if it is possible without using numbers. I hope you understand what I'm trying to explain. It's quite hard!
    You say where the cutoffs are, is that A=90-100%?
    Can you just use letters to make an average of the letter? 
    AVERAGE, which calculates the arithmetic mean of a set of values, works with numerical values.
    On your posted layout, you have a table showing the letter equivalent of a percentage score:
    A score under 40 = E
    A score 40 or higher, but under 50 = D
    A score 50 or higher, but under 65 = C
    A score 56 or higher, but under 85 = B
    A score 85 or higher = A
    Those numerical scores may be summed, averaged, and a letter grade assigned. With the specifications given in that table, the letter grade will not include a + or -.
    Your layout includes nine numerical scores for the first student (all of which are well under 40. My assumption here is that each is the student's score out of the number in the same column of row 3 (ie, the first, 13, is 13 out of 14, the second is 10 out of 16, etc,)
    This raises a question:
    Does each point noted contribute equally to the final average?
    Or
    Does each quiz/exercise contribute equally to the final average?
    For the letter grades to be averaged, you will need to set a specific numerical equivalent (not a range) for each letter grade.
    For the letter grades and number grades to be combined into a single final letter grade, the numerical equivalents noted above must be chosen with that goal in mind, OR the numerical scores must be converted into letter grades, then reconverted into specific numerical equivalents for each letter grade, inserted into the set of (converted) letter grades, averaged, then reconverted to the equivalent letter grade.
    As you can see, there are yet a few hurdles to overcome.
    Regards,
    Barry

  • How do I clear the bubbles that say recent when you double click ?  Plz help

    Just when you least expect it, well there you go it's happening again. Do you close your eyes and forget or  stand there

    I have been having this issue for some time as well. Currently on 10.10.1 - which also added a new issue. After I connect to a system the recent item shows up as ComputerName.vncloc and clicking on that fails to connect with a message to check if Screen Sharing is activated on the remote system. When I go through a Finder window it works fine but right click off the screen sharing dock item only sometimes works.

  • Is there a button combination that will wipe out all phone data

    I'll be turning in my iPhone 4  to Verizon to obtain the $200 credit against an iPhone 6. What is the recommended way to wipe out all my personal data that is currently on the phone?
    Mark

    Go to settings>general> reset > erase all content and settings.
    there is also an article from apple:
    What to do before selling or giving away your iPhone, iPad, or iPod touch

  • Apache stops when I log in via ssh and log out

    What do I check to troubleshoot this?
    I've run journaletc, systemd status, dmesg.

    So what is in your journalctl, systemd status & dmesg when this happens?

  • Any news about the new droid phones that will come out for next year?

    so after my post about the EOL of phones for 2011, i was wondering if there were any phones that were coming out that would be as good as the Droid X. i liked the X bc it was big enough for me (im 6'2 and pretty big) and i liked how the OS was set up for customization of widgets and stuff.

    Yeah, Here is one phone you might like that's coming out in February. 
    The HTC Merge
    http://www.phonearena.com/news/HTC-Merge-emerged-in-its-full-glory-on-the-Verizon-site-taken-down-swiftly_id14777

  • Windows Randomly Freezes when Resource Monitor Disk Highest Active Time Maxed Out

    I'm getting this same problem as this person:
    http://social.technet.microsoft.com/Forums/en-US/w7itproperf/thread/4e33c8d9-fc3d-434b-8dd0-29965d1aa0a2
    Except that it seems to happen at random.  While playing a game, browsing the net or when it's just sitting idle.  
    Hard drive light goes solid, the blue line (% highest active time) in the resource monitor disk graph stays peaked at 100% but
    relatively little or no hard disk activity.  
    My mouse is also usually still responsive. 
    Some apps will continue to work, but if I click on them they will usually become unresponsive, same goes if I attempt to click on the Windows Start button.  If I'm playing a game, it will stutter or freeze and a .5-1 second sound clip will continuously loop
    until it's done (meaning the hard drive light is no longer solid and blue line is no longer peaking). 
    It is also the same for me that occasionally the OS will freeze completely and I will need to hold down the power button to reboot, but this is usually more rare.
    I've checked the Event Viewer and there are no errors that coincide with the problem. 
    I've run chkdsk and no errors were returned.  Same when I ran Memtest86+ to check RAM, no errors.
    My stats are:
    -Windows 7 Ultimate 64 bit SP1
    -Intel Core i-7 960 3.2Ghz 
    -eVGA 132-BL-E758-A1 X58 Motherboard
    -Corsair Dominator 12GB TR3X6g1600C8
    -eVGA 012-P3-1472-AR GeForce GTX 470 (Fermi) SuperClocked 1280MB 320-bit GDDR5 (x2 SLI)
    -CORSAIR HX Series CMPSU-850HX 850W ATX12V 2.3 / EPS12V 2.91 80 PLUS SILVER Certified Modular PSU
    -VelociRaptor WD3000HLFS 300GB 10000 RPM 16MB Cache SATA 3.0Gb/s HDD (x2 RAID 0)

    Hi,
    How about updating the BIOS and all devices' driver from the manufacture's site?
    I suspect it is the task schedule running in the background. If you want to narrow down the issue, you may need some monitor tools and then analyze.
    http://technet.microsoft.com/en-us/sysinternals/bb896645
    To analyze the process, it is better to contact Microsoft Customer Service and Support (CSS) via telephone to get more efficient support.
    Microsoft Customer Service (800) 426-9400 is available Monday through Friday, from 6:30 A.M. to 5:30 P.M. pacific time.
    Best Regards,
    Niki
    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

Maybe you are looking for

  • Installation fails at 76% complete.

    I have been trying to install Adobe reader, after having to uninstall the program, to rectify an updating problem. The attempts to install Reader fail at 76% complete and the error code is "null". I have tried the recommend fixes that come from the A

  • Unable to get backed up data in pages after iCloud restore

    hi friends, i restored my ipad from an i iCloud backup. i am able to see all data restored including numbers but not of pages. when i go to the iCloud tab, i am seeing all the documents listed, but they don't appear in pages. any guidance on this wil

  • Want last date of the month as default basic finish date for the Proc order

    For forward scheduling type in process order, irrespective of the start date i want last date of the month as my  basic finish date. Ex start date can be 01/10/2009 or 15/10/2009, but the basic finish date should be 31/10/2009.

  • Airport network doesn't allow me to open my work exchange mail...

    I have attempted for quite some time to open a link I created to bring me to my microsoft exchange web mail. However on the airport network I created the page just loads for ever and finally comes up with a safari message that says "page couldn't not

  • LSD problem in Lenovo B450

    So, im wrote all history about problems with this problem.... When i, take this laptop, him have problem with KBC controller, Battery not charging and Keyboard not work... im open case and view mainboard, damage component's will be not found... LSD p