Beispiel #1
0
 /// <include file='../../docs.xml'
 /// path='docs/doc[@name="M:PeterO.Numbers.ETrapException.#ctor(System.Int32,PeterO.Numbers.EContext,System.Object)"]/*'/>
 public ETrapException(int flag, EContext ctx, Object result) :
     base(FlagToMessage(flag))
 {
     this.error  = flag;
     this.ctx    = (ctx == null) ? null : ctx.Copy();
     this.result = result;
 }
Beispiel #2
0
 /// <summary>Initializes a new instance of the
 /// <see cref='PeterO.Numbers.ETrapException'/> class.</summary>
 /// <param name='flags'>Specifies the flags that were signaled as the
 /// result of one or more operations. This includes the flag specified
 /// in the "flag" parameter, but can include other flags. For instance,
 /// if "flag" is <c>EContext.FlagInexact</c>, this parameter might be
 /// <c>EContext.FlagInexact | EContext.FlagRounded</c>.</param>
 /// <param name='flag'>Specifies the flag that specifies the primary
 /// kind of error from one or more operations (EContext.FlagXXX). This
 /// will only be one flag, such as <c>FlagInexact</c> or
 /// FlagSubnormal.</param>
 /// <param name='ctx'>The arithmetic context used during the operation
 /// that triggered the trap. Can be null.</param>
 /// <param name='result'>The defined result of the operation that
 /// caused the trap.</param>
 /// <exception cref='ArgumentException'>The parameter <paramref
 /// name='flags'/> doesn't include all the flags in the <paramref
 /// name='flag'/> parameter.</exception>
 public ETrapException(int flags, int flag, EContext ctx, Object result)
     : base(FlagToMessage(flags))
 {
     if ((flags & flag) != flag)
     {
         throw new ArgumentException("flags doesn't include flag");
     }
     this.error  = flag;
     this.errors = flags;
     this.ctx    = (ctx == null) ? null : ctx.Copy();
     this.result = result;
 }
Beispiel #3
0
 /// <include file='../../docs.xml'
 /// path='docs/doc[@name="M:PeterO.Numbers.ETrapException.#ctor(System.Int32,PeterO.Numbers.EContext,System.Object)"]/*'/>
 public ETrapException(int flag, EContext ctx, Object result) :
   base(FlagToMessage(flag)) {
   this.error = flag;
   this.ctx = (ctx == null) ? null : ctx.Copy();
   this.result = result;
 }