Trying to learn the Math.max function

Hello,
I am trying to figure out how to use the Math.max funtion. Here is my simple code, but it has an error.
Anyone know what I did wrong here.
thanks
function myBiggie(); {
Math.max(4:Number,19:Number);
myBiggie();
babs

You're welcome.  Here's another version that makes a little more "useful" sense (not making a point, just demo-ing some things)...
function myBiggie(num1:Number, num2:Number):Number {
     return Math.max(num1, num2);
var biggest:Number = myBiggie(4,19);
trace(biggest);

Similar Messages

  • Trying to do the math... (HDD related)

    Hi,
    I am putting together a new PC for editing and was wondering, how fast a HDD really has to be?! I read all the FAQ and understand, that there are plenty of suggestions out there, on how to setup your HDD's! However, I would like to be able to do the math myself and understand, why a given setup is recommended! If I take some 4K Cin footage of my GoPro Hero 3 BE, and enter the information here:
    http://web.forret.com/tools/video_fps.asp?width=4096&height=2160&fps=15&space=rgb444&depth =10 
    (4096 x 2160, 15FPS, RGB 4:4:4 and 10 bits/color... I just picked something for demonstration purposes only) it tells me, that the Uncompressed bitrate is 497,66 MB/s.
    If I now look at a chart like this:
    http://www.tomshardware.com/charts/hdd-charts-2013/-01-Read-Throughput-Average-h2benchw-3. 16,2901.html 
    and pick a HDD, with lets say 150MB/s, what does this now mean?! The bitrate is clearly higher than the "speed" of the HDD. Does this mean, my playback is going to be jerky?! I believe so, but I am not sure what part a graphics Card plays here?! I also understand, that a slow HDD, can act as the bottle neck of a given system. So no matter how fast your CPU is, a slow HDD setup will slow the whole system down. But how fast does a HDD really have to be, so it doesn't slow the system down?! Is there some way to do the math and know in advance, what is going to work and what not?! Or is it as simple as picking a SD card for a GoPro?! If my video format delivers, lets say 500MB/s, I would need a SD card that is at LEAST this fast, so it can capture the video without dropping frames, right?! At least this is how I understand it, ha ha.
    It must work a little bit different on a PC though, since the footage doesn't have to be captured in real time, correct?! A slow HDD is now going to just increase render times, right?!
    G, I am so tired of trying to explain, what I mean, LOL. Hopefully all of this will make sense to someone out there?!
    thanks,
    KMD
    p.s. Maybe it is really as simpe as just taking the bitrate for one track, adding all tracks up and whatever number comes up, your HDD has to be at least that fast, LOL?!

    SAFEHARBOR11 wrote:
    The 8-drive RAID reference was in regards to the "4:4:4 10-bit uncompressed HD" example that you offered. I sell those drives, part of my job, that is how I know. But this does not apply to GoPro footage, the above example is very rare, stuff Hollywood-types might use and not for you or I to worry about.
    Black Magic Design has a drive speed test utility that you can run and it will tell you what video formats will work with your drive setup. There are also charts and tools out there, such as AJA Data Rate Calculator for PC or Mac, and now available from Apple App Store for iPhones - http://www.aja.com/en/software
    Please note when playing with the calculator that if the format is "8-bit" or "10-bit" that references UNCOMPRESSED video, and you are not working with that. Since the calculator doesn't list the GoPro (Cineform) codec, not sure what the data rate is going to be, but much lower for sure.
    Looking at the requirements for GoPro Studio Premium, they are recommending a 7200rpm unit, and fast connection if external, but nothing fancy so I wouldn't worry about needing any special drives.
    Thanks
    Jeff Pulera
    Safe Harbor Computers
    Jeff,
    I am planning on using 4k in the near Future, so I need to worry about it, ha ha. The other thing is, a tool that measures my drive speed is useless for me, as of right now, since I do not have a system yet! Working on putting one together as we "speak". Anyhow, you pointing out the AJA Data Rate Calculator to me, is what made me realize, that I had the answer in front of me, the whole time!
    http://web.forret.com/tools/video_fps.asp?width=4096&height=2160&fps=15&space=rgb444&depth =10
    Either AJA or this site, will help me figuring out the data rate of most video formats... I have no idea why I didn't realize that the first time?! I read my OP and I want to delete it, ha ha...
    Thanks again for all the help!
    KMD

  • Getting error when tried to learn the documents in OFR Designer

    Hi All,
    As per project requirements, I have to create Classification and Verification LearnSets in Oracle Form Recognition Designer depending on three Invoice Types-- PO,Non-PO and Pre-Approved.
    First I created three derived classes under Generic Class -- PO,Non-PO and Pre-Approved.
    I can add documents in Classification and Extraction LearnSet, analyze them, but getting error when click on the Learn button, I couldn't make the engine ready in learned state from the Definition Mode.
    Always getting the below two errors:-
    1) Cannot compile. May be not enough classes defined or too few documents assigned to the classes.
    Cannot learn the BrainwareView : DefaultView
    SERbrainware : Learn, learning error (7)
    2) Cannot compile. May be not enough classes defined or too few documents assigned to the classes.
    Cannot create Brainware Dictionary for BrainwareView : DefaultView
    SERbrainware : Create/AppendDictionary, preprocessing error (3)
    Thanks in advance,
    Moumi.

    Hi All,
    The below mentioned error were resolved after adding documents in Void Class.
    Thanks,
    Moumi.
    Edited by: 903667 on Jan 31, 2013 8:34 PM

  • Problem with the math library functions

    Hi,
    I encountered a problem related to some functions provided by math library on sun. I narrowed it down to the following test program:
    ========================================================
    #include<stdio.h>
    #include<math.h>
    void pow_res()
    double x = 10.0;
    double y = 2.5;
    printf("pow(%.2e, %.2e):%.20e\n", x, y, pow(10.0, 2.5));
    void cos_res()
    double x = -6.433230338433114370e-02;
    printf("x:%.20e cos(x):%.20e\n", x, cos(x));
    int main()
    pow_res();
    cos_res();
    return 0;
    ========================================================
    The above test program has to be linked with any math library. It is �libm� for amd64/linux, but for sparc we have choice between �libm� and �libmopt�. I am compiling above program with "cc <test_program.c> <-lm/-lmopt>" command.
    On sparc, if the above test program is getting linked with �-lm" then it gives same results for the �cos� on both amd64 and sparc, but gives different results (16th decimal digit onward) for �pow�. If it is getting linked with �-lmopt� then it gives same result for the �pow� on both the platforms, but gives different results for �cos�. Linux results match with the amd64 results.
    The �Numerical Computation Guide� provided by SUN (ftp://docs-pdf.sun.com/802-5692/802-5692.pdf page 40, table 2.10 ) says that you can trust only 15-17 decimal digits for double calculation. But here the requirement is to match the sparc results exactly with the amd64/linux or at least match the result till 20th decimal digit. I guess it is something to do with the FPU setting either through compiler options or code. I tried many different compiler options, like -fast, different combinations of compiler options provided by -fast macro, but nothing helped.
    Following is the system configuration:
    Amd64:
    gcc version: 3.3.6
    OS: RedHat Enterprise Linux 3.0 U7 (Linux 2.4.21-40.ELsmp x86_64)
    Sparc:
    cc version: Sun C 5.8 Patch 121015-01
    OS: SunOS 5.9 Generic_118558-21 sun4u sparc SUNW,Sun-Fire-280R
    It will be great if somebody can explain the problem and the solution to get rid of it.
    Many thanks,
    Sunil

    Transcendental functions are not specified to be correctly rounded in the same
    sense as +-*/.     So it's entirely possible, and often observed, that libraries of equal
    quality deliver slightly different results.
    To simplify, suppose one wanted to compute x = 4*atan(1.0)
    which happens to be the
    transcendental number pi which is roughly, in hex and in decimali:
    .C90F DAA2 2168 C234 C... * 2^4 or 3.141592653589793239...
    But binary floating-point arithmetic can only represent certain rational numbers of
    the form of an integer of at most 53 significant bits times a power of two. The
    nearest double-precision number to pi is
    .C90F DAA2 2168 C * 2^4 or roughly 3.141592653589793116...
    This particular number has a large but finite decimal expansion. And if you
    do printf with %e.20 you will get the 20 decimal digits of that double-precision
    number's expansion, not the 20 decimal digits of pi, which only agrees to the
    15 significant decimals 3.141592653589793 and differs afterward.
    In the case of pow(10.0,2.5), (which happens to be sqrt(1.0e5))
    the correct result in hex looks something like
    .9E1D 276F D4BA C410 C... * 2^9 or roughly 3.162277660168379332...E+2
    in hex notation, while the closest double precision number is
    .9E1D 276F D4BA C8 * 2^9 or roughly 3.162277660168379612...E+2
    but it's only slightly closer than the next closest double precision number
    .9E1D 276F D4BA c0 *2^9 or roughly 3.162277660168379043...E+2
    Either answer is a good answer, and math libraries might that only aspire to
    deliver results that are close to correctly rounded might deliver either, depending
    on which approximation algorithm is used, which might depend on what's fastest
    on a particular processor.
    So why don't math libraries deliver correctly rounded results instead of almost?
    Because the slight extra increase in accuracy doesn't do much good for most
    people, and the major decrease in performance is noticeable by lots of people.
    The main payoff of correctly rounded transcendental functions is that they
    promote uniform numerical results across platforms, which is worth something
    to some people but not much to many people.
    So for those who find it worthwhile, there are correctly rounded transcendental
    function libraries available. Sun's development version is available at
    http://www.sun.com/download/products.xml?id=41797765
    Another solution for some people is to change double variables and functions
    to long double, using powl and cosl in the examples. That increases the
    accuracy to almost 20 digits on x86 and over 30 digits on SPARC, and while
    the same issues eventually arise, most users would never encounter them.
    The SPARC long double implementation is in software rather than hardware,
    and so entails a major performance reduction compared to double.
    The Numerical Computation Guide at docs.sun.com discusses many of these
    issues at greater length.

  • Where do I find the SUM & MAX functions under update rule, TYPE: FORMULA

    Hi,
    If I am setting up an update routine
    TYPE: FORMULA
    where do I find the function SUM ?
    I need to take the sum of a particular key figure under certain condition with the statement:
    IF( <condition>, <result when true>, <result when false> )
    i.e.
    IF( field1 > field2, Sum of Field3, Sum of Field3 )
    I canu2019t seem to find the Sum function. I found +, -, / etc under Basic Functions. Even under all u201CAll functionsu201D, I only see u201Csummarizeu201D but not sum.
    --Also where do I find the MAX and MIN functions if I want to use them in FORMULAS?
    Thanks

    Hi......
    Its better you go for calculated keyfigure
    Check this link :
    http://help.sap.com/saphelp_nw04/helpdata/en/6f/56853c08c7aa11e10000000a11405a/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/EN/13/e072abaddb574284d22361f0b824bf/content.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/72f4a790-0201-0010-5b89-a42a32223ffc
    It may help you......
    Regards,
    Debjani......
    Edited by: Debjani  Mukherjee on Sep 28, 2008 6:17 AM
    Edited by: Debjani  Mukherjee on Sep 28, 2008 6:23 AM

  • New FCP user trying to learn the correct project and export settings for HD

    Hi, I am a novice and have used FCP on my laptop for university projects only, and now have been asked to cut a trailer for a 7 min HD Pilot.
    A. I had to work in a different part of the country for the last 2 weeks therefore making this more problematic for myself long term hence:
    B. I have only been given a QT file of the pilot, as to cut a rough idea of the trailer, which I will then have to redo with the original HD files, when I return to them tomorrow.
    C. I created a low res QT to work with in FCP and have probably set up my project in a odd/wrong way and need to export this DV low res version for viewing by tomorrow, and I would ideally like it to look like the right aspect ratio and what not.
    I know very little about ratios and interlaced and progressive files, and this project has been shot manly on a digital SLR camera for the animation, it has After Effects files and with sections of live action which I think was shot in HD 'i' mode.
    I would like to learn quickly the sort of setup I should have for this kind of project, how I should export this low res DV version for viewing and for exporting the final HD project with what settings I should use.
    I am sure I should have detailed more information, but as it is im not sure what is relevant. I can find out if im pointed in the right direction.
    Hope someone can help
    Cheers
    Kat

    B. I have only been given a QT file of the pilot, as to cut a rough idea of the trailer, which I will then have to redo with the original HD files, when I return to them tomorrow.
    Well, this will make cutting more difficult. Because a low res version of the trailer will not have any timecode...nothing that references the main movie. So you will do the cut with the QT movie and then have to go back and eyematch-cut the trailer with the high res footage. Not fun and very time consuming. Not to mention that you will be cutting with the mixed audio of the trailer, including music and that will not sound right when you cut the trailer with the new music.
    You need a QT version of the movie that contains the timecode of the original master (using media Manager to recompress to DV or other offline codec will do this), and you REALLY need to get split track audio. If they are record producers, they'll know what that is.
    Shane

  • Why does firefox crash when i am trying to use the google search function?

    I use Windows 7 and have Firefox 3.6.23 installed. I have no problem with most websites, but Firefox crashes every time I try to do Google searches. So far this issue is only happening with Google.

    See below. If anyone can help with this, I would appreciate it.
    Add-ons: {CAFEEFAC-0016-0000-0024-ABCDEFFEDCBA}:6.0.24,{CAFEEFAC-0016-0000-0026-ABCDEFFEDCBA}:6.0.26,{4ED1F68A-5463-4931-9384-8FFF5ED91D92}:3.4.0,{972ce4c6-7e08-4474-a285-3208198ce6fd}:3.6.23
    BuildID: 20110920075126
    CrashTime: 1318036312
    EMCheckCompatibility: true
    Email: [email protected]
    FramePoisonBase: 00000000f0de0000
    FramePoisonSize: 65536
    InstallTime: 1317382785
    ProductName: Firefox
    ReleaseChannel: release
    SecondsSinceLastCrash: 402
    StartupTime: 1318035938
    Theme: classic/1.0
    Throttleable: 1
    URL: http://www.google.com/
    Vendor: Mozilla
    Version: 3.6.23
    This report also contains technical information about the state of the application when it crashed.

  • Javascript math.max bug in AE cs5

    Sombody please explain to me why the following script:
    var test = 0;
    test = Math.max (8,26,22);
    alert (test);
    outputs "22" in after effects CS5.
    am i just missing something really simple or is this a bug?
    the same code in a browser works fine.

    Yes, but it doesn't work in CS5.
    I noticed that in CS5 the result of the Math.max function depends on the order of the arguments as well as their values, but I always only use it with 2 arguments so I never really cared.
    It looks like each value is compared to the first one, and the value returned is the last argument found that is greater than the first one.
    So Math.max(1.5, 4, 3, 2, 1) will return 2 because the arguments following are lower than 1.5
    So Math.max(2.5, 4, 3, 2, 1) will return 3 because the arguments following are lower than 2.5
    and Math.max(2.5, 3, 4, 2, 1) will return 4 because the arguments following are lower than 2.5
    So it's safer to do what Dan suggested and break the max calculations with a loop. something like:
    var values = [ ... an array of values ... ];
    var maxValue = values[0];
    for (var i=1; i<values.length; i++)
        maxValue = Math.max(maxValue, values[i]);

  • Keynote crashes when trying to use the move function

    Hi there.
    I am running latest version of OSX and Keynote, but when I try to create a move-animation with a picture/an object, Keynote crashes and shuts down. Two of my collegue have the same problem. Any solution out there?
    Best reg.
    Morten Isachsen

    By the way, it also crashes when trying to use the Direct Alpha function on an image.
    Hmmmm...?

  • Trying to learn zsh completion. Help me achieve it?

    Hi,
    I'm trying to learn to write completion functions for zsh, and started by writing one for unison, which looks in the profiles directory to tab-complete profiles. So far, I've got a _unison file containing the following:
    #compdef unison
    #typeset -A opt_args
    local profiles
    profiles=~/.unison
    _files -W ${profiles} -g '*.prf' && return 0
    return 1
    Which works relatively well:
    % unison <tab>
    default.prf documents.prf photographs.prf
    Just for the fun of it really, I'd like to remove the .prf bit and just have it complete the basename. Any idea how I can achieve this?
    Thanks :-)

    I don't think 'basename' is the right word.
    This works for bash:
    for i in *.txt; do echo ${i%%.*}; done
    Now you have to somehow add it to your workflow.

  • How do I use the Match Pattern Function to exclude only 0.000?

    Hi,
    I'm trying to use the mattch pattern function to find the first string in a table thats is >0. My table looks like:
    1,0.000000,0.000 %2007/01/13 00:16:19 196281
    1,0.000000,0.000 %2007/01/13 00:16:22 196282
    1,0.831262,0.000 %2007/01/13 00:17:20 196375
    2,0.811154,0.000 %2007/01/13 00:17:20 196375
    If I us the paremeter "1,[~0]" It doesn't find the line 1,0.831262,0.000... which is the one that I want. I also tried :1,[0-9].+[~0] and that didn't work either. the problem is that the first digit after to 1, isn't allways going to go from 0 to 0.0 sometimes it might go from 0 to 2.??.
    Thanks for the help
    Matt

    "Matt361" <[email protected]> wrote in message news:[email protected]..
    Hi,
    &nbsp;
    I'm trying to use the mattch pattern function to find the first string in a table thats is &gt;0. My table looks like:
    1,0.000000,0.000 %2007/01/13 00:16:19 196281
    1,0.000000,0.000 %2007/01/13 00:16:22 196282
    1,0.831262,0.000 %2007/01/13 00:17:20 196375
    2,0.811154,0.000 %2007/01/13 00:17:20 196375
    If I us the paremeter "1,[~0]" It doesn't find the line 1,0.831262,0.000... which is the one that I want. I also tried :1,[0-9].+[~0] and that didn't work either. the problem is that the first digit after to 1, isn't allways going to go from 0 to 0.0 sometimes it might go from 0 to 2.??.
    &nbsp;
    Thanks for the help
    Matt
    &nbsp;
    Hi,
    1,[~0] matches a "1" a "," and then any character that is not "0".
    1,[0-9].+[~0] matches a "1" a "," and then any character that is "0-9", any number of anything!! (1 or more) and then anything that is not "0". Note that you have to escape a . to match a ".". Like this "\.".
    There is no way to check if there is anything other then a "0" in the match, from within the match pattern function. So I think you won't be able to find a pattern that does the trick.
    Why not use a whileloop to find the first item? Or use the Spreadsheet String To Array, and then compare the desired row or column with the string "0.000000"? (Or replace all ,0.000000, by a string like ",NULL,", then match the pattern?)
    In LabVIEW 8 there is a new Match Regular Expression function. Haven't tried it, but it should be much more powerfull then the Match Pattern function. But also much more complex.
    Regards,
    Wiebe.

  • Using the Array SetElements function

    Hi All,
    I'm trying to use the Array SetElements function to set a value to specific indices within an initialized array but I cannot figure out what the syntax is for the optional parameter 2. I've tried a whole bunch that seem to make sense but always get an error. Has anyone used this function before who can let me know what the syntax to use is?
    Thanks,
    Nick
    Solved!
    Go to Solution.

    Nick,
    So the syntax for setting all of the elements to a value can simply be written:
    SetElements( myArray,valueToSet )
    To add in the optional parameter 2 and define a range is something like this:
    SetElements( myArray,valueToSet, "[3..6]" )
    The .. operator is analagous to a : in Matlab.
    Good luck,
    Chris

  • What is the output on the FFT PSD function?

    I am trying to evaluate the FFT PSD function relative to frequency. I expect f(0) = the variance of all signals, but that is not what is given. Does anyone have any information about this. I ran a test array with a 1 Hz sin wave, with 10 samples/second, 120 total data points--the FFT PSD gives f(0)=0.

    Hi,
    The LabVIEW help file gives the following information concerning this function:
    The FFT Power Spectral Density VI completes the following steps to compute power spectral density.
    Computes the FFT of time signal.
    Forms the power spectral density of time signal.
    Averages the current power spectral density with the power spectral densities computed by the VI since the last time the averaging process was restarted.
    Returns the averaged power spectral density in power spectral density
    The single-channel version of this VI can perform single-channel measurements in both one-shot mode, meaning a single call, and continuous mode, meaning multiple calls with history. The single-channel version can perform multichannel measurements only in one-shot mode. If you want to make multichannel measurements in continuous mode, use the multichannel version of this VI.
    The single-channel version of this VI maintains internal state information for a single channel only. Calling the single-channel version to process another channel without using the restart averaging control to clear the history results in an unexpected behavior of this VI. The unexpected behavior results from the VI passing the internal state information from one channel to another.
    Note  The single-channel version of this VI is primarily intended for continuous processing of a single channel. Do not generalize this behavior to the multichannel case and use the single-channel version in a For Loop to continuously process multiple channels by indexing an array of waveforms. Refer to the examples\measure\maxmpl.llb and the examples\analysis\measxmpl.llb for examples of how to use a multichannel version of a VI like the FFT Power Spectral Density VI in a loop.
    Refer to the Noise Waveforms and PS Density VI in the labview\examples\measure\maxmpl.llb for an example of using the FFT Power Spectral Density VI.
    Amanda Howard
    Americas Services and Support Recruiting Manager
    National Instruments

  • Using the photomerge panorama function in Elements 10

    I have just installed Elements 10 and when trying to use the Photomerge Panorama function the whole programme shuts down. I have tried re-installing the programme and the problem is still there. I have tried using the instructions fron The Dummies handbook but the problem persists.

    I've moved your question to the Photoshop Elements forum to get the best results.

  • Customizing the "DISABLE USER"  Function

    Hi.
    I am trying to customize the *"Disable User"* Function in IDM.
    I have created a small User Form, which contains a simple Checkbox. When this Checkbox is checked, I would like to DISABLE a given User.
    Basically, I know that this can be done from the Main IDM User Interface (User-----Disable), etc, etc. But, I actually want to Disable this particular function completely.
    What I mean is : I want to disable it for certain Admin Users.
    So, I guess I have two questions :
    (a) If I disable this function for a particular Administrator (meaning, this administrator would NOT have the capability to disable users), then would this same administrator still have the capability to DISABLE users via the user form which I created?
    (b) How exactly can I invoke/execute the "DISABLE USER" function from my user form? When the "Checkbox" there is checked...........*what then?*
    Thanks.

    Oops! Slight problem.
    The code you gave me doesn't seem to work. I keep getting the error "Unknown op value"
    (I think it's referring to the part where : *"<Argument name='op' value='disableUser'/>"*
    However, I might have a solution : perhaps the problem stems from the fact that I am using a CHECKBOX, to activate "Disable User";
    perhaps, I ought to be using something else *(like, a BUTTON).*
    Logically, this might make sense (and it might explain why I am getting that error).
    Let's say that I disable a user by "checking" that checkbox; but, what if I want to RE-ENABLE that User? Of course, I could simply insert another "Action", which enables user by "Un-checking". But, perhaps, the workflow would prefer if I simply had two separate Buttons : one for ENABLE, another for  DISABLE.
    What do you think about this?
    Thanks, Sec_Tk
    P. S. Sorry, but you didnt mention what I asked about initially : if a certain Administrator does not have the "DISABLE USER"  capability, can he still effectively perform this "Disable" task from the User Form?

Maybe you are looking for