Strange behaviour, multiplying decimals (IE)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dr J R Stockton

    #16
    Re: Strange behaviour, multiplying decimals (IE)

    In comp.lang.javas cript message <3vednUyLe7mf2G Hb4p2dnAA@gigan ews.com>,
    Thu, 27 Sep 2007 20:05:55, FAQEditor <cljfaq@comcast .netposted:
    >Dr J R Stockton said the following on 9/26/2007 4:47 PM:
    No; I posted it at Wed, 26 Sep 2007 21:47:19 +0100, having written it
    before that time.

    >The version of function StrU in the FAQ is well-known to be out-of-date.
    >
    >Then perhaps you would care to post a new updated version? And I will
    >be happy to add it. I am not going to hunt it down and guess at it
    >though.
    If you find the link in the FAQ inadequate, please explain why. It's
    only one obvious step from there to js-rndg1.htm#GC .

    ><FAQENTRYTo FAQ 4.7, new para 2.5 : "Otherwise, use Math.round on the
    >results of expressions which should be of integer value.";
    >
    >Added locally.
    >
    >and move the last sentence of 2.0 to precede that in 2.5.
    >
    >I have to assume that your "2.0" is a typo as I have no 2.0 in my local
    >version.
    If you understand "2.5", you should be able to understand "2.0". The
    recommendation amounts to shifting a paragraph break.

    --
    (c) John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v6.05 MIME.
    Web <URL:http://www.merlyn.demo n.co.uk/- FAQish topics, acronyms, & links.
    Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
    Do not Mail News to me. Before a reply, quote with ">" or "" (SonOfRFC1036)

    Comment

    • Dr J R Stockton

      #17
      Re: Strange behaviour, multiplying decimals (IE)

      In comp.lang.javas cript message <Xns99B9B158210 ACeejj99@194.10 9.133.242>
      , Fri, 28 Sep 2007 15:26:01, Evertjan. <exjxw.hannivoo rt@interxnl.net >
      posted:
      >
      >function Sign(X) {return ' -+'.charAt(!X?0: X<0?1:2)}
      >
      function Sign(X) {return '+ -'.charAt(X<0?2: !X)} // is shorter

      --
      (c) John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v6.05 IE 6.
      Web <URL:http://www.merlyn.demo n.co.uk/- w. FAQish topics, links, acronyms
      PAS EXE etc : <URL:http://www.merlyn.demo n.co.uk/programs/- see 00index.htm
      Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.

      Comment

      • Randy Webb

        #18
        Re: Strange behaviour, multiplying decimals (IE)

        Dr J R Stockton said the following on 9/28/2007 5:07 PM:
        In comp.lang.javas cript message <3vednUyLe7mf2G Hb4p2dnAA@gigan ews.com>,
        Thu, 27 Sep 2007 20:05:55, FAQEditor <cljfaq@comcast .netposted:
        >Dr J R Stockton said the following on 9/26/2007 4:47 PM:
        >
        No; I posted it at Wed, 26 Sep 2007 21:47:19 +0100, having written it
        before that time.
        You should endeavor to understand how screen readers work. But, are we
        back to the attribution BS again?
        >
        >>The version of function StrU in the FAQ is well-known to be out-of-date.
        >Then perhaps you would care to post a new updated version? And I will
        >be happy to add it. I am not going to hunt it down and guess at it
        >though.
        >
        If you find the link in the FAQ inadequate, please explain why.
        Thanks, but no thanks. If you find the FAQ code inadequate and want it
        changed, then you post a URL, or the code, to the group and then I will
        change it.
        It's only one obvious step from there to js-rndg1.htm#GC .
        And in the time you have spent waffling about posting it you could have
        simply posted the new code, it would have gotten updated locally -
        probably online as well - and all would be moving along nicely. Instead,
        we are having a conversation about steps and what is obvious to find in
        a site that I find a nightmare to try to traverse.

        >><FAQENTRYTo FAQ 4.7, new para 2.5 : "Otherwise, use Math.round on the
        >>results of expressions which should be of integer value.";
        >Added locally.
        >>
        >>and move the last sentence of 2.0 to precede that in 2.5.
        >I have to assume that your "2.0" is a typo as I have no 2.0 in my local
        >version.
        >
        If you understand "2.5", you should be able to understand "2.0". The
        recommendation amounts to shifting a paragraph break.
        If you can't understand that there is no 2.0 in the FAQ, then nothing
        else would make sense to you either. Again, if you would simply state
        what you think should be changed instead of being so moronically obtuse
        about it then things would get updated a lot quicker than they do. Try
        it sometime.

        --
        Randy
        Chance Favors The Prepared Mind
        comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
        Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

        Comment

        • Evertjan.

          #19
          Re: Strange behaviour, multiplying decimals (IE)

          Dr J R Stockton wrote on 28 sep 2007 in comp.lang.javas cript:
          In comp.lang.javas cript message Evertjan. posted:
          >>
          >>function Sign(X) {return ' -+'.charAt(!X?0: X<0?1:2)}
          >
          function Sign(X) {return '+ -'.charAt(X<0?2: !X)} // is shorter
          Indeed.

          This one is longer, but does not use any tertiary operator:

          function Sign(X) {return ' +-'.charAt(!!X+(X <0))}

          would it be faster?

          --
          Evertjan.
          The Netherlands.
          (Please change the x'es to dots in my emailaddress)

          Comment

          • Evertjan.

            #20
            Re: Strange behaviour, multiplying decimals (IE)

            Evertjan. wrote on 29 sep 2007 in comp.lang.javas cript:
            Dr J R Stockton wrote on 28 sep 2007 in comp.lang.javas cript:
            >In comp.lang.javas cript message Evertjan. posted:
            >>>
            >>>function Sign(X) {return ' -+'.charAt(!X?0: X<0?1:2)}
            >>
            >function Sign(X) {return '+ -'.charAt(X<0?2: !X)} // is shorter
            >
            Indeed.
            >
            This one is longer, but does not use any tertiary operator:
            >
            function Sign(X) {return ' +-'.charAt(!!X+(X <0))}
            Or we could compute the characters from their unicode value:

            function Sign(X) {return String.fromChar Code(43-!X*11+(X<0)*2)}



            --
            Evertjan.
            The Netherlands.
            (Please change the x'es to dots in my emailaddress)

            Comment

            • Dr J R Stockton

              #21
              Re: Strange behaviour, multiplying decimals (IE)

              In comp.lang.javas cript message <Xns99BA6B53942 4Feejj99@194.10 9.133.242>
              , Sat, 29 Sep 2007 08:33:02, Evertjan. <exjxw.hannivoo rt@interxnl.net >
              posted:
              >Dr J R Stockton wrote on 28 sep 2007 in comp.lang.javas cript:
              >In comp.lang.javas cript message Evertjan. posted:
              >>>
              >>>function Sign(X) {return ' -+'.charAt(!X?0: X<0?1:2)}
              >>
              >function Sign(X) {return '+ -'.charAt(X<0?2: !X)} // is shorter
              >This one is longer, but does not use any tertiary operator:
              >
              >function Sign(X) {return ' +-'.charAt(!!X+(X <0))}
              >
              >would it be faster?

              Even including the one you posted next, the differences are
              insignificant, and will depend on the sign of the argument and
              therefore, overall, on the proportion of positive, negative, zero.

              As most results are positive (IMHO), this should be insignificantly
              better :

              function Sign(X) {return '- +'.charAt(X>0?2 :!X)}


              --
              (c) John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v6.05 MIME.
              Web <URL:http://www.merlyn.demo n.co.uk/- FAQqish topics, acronyms & links;
              Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
              No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

              Comment

              Working...