Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3441016
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:30:04+00:00 2026-05-18T08:30:04+00:00

This is for a mathematical method that takes in 3 doubles as input (a,

  • 0

This is for a mathematical method that takes in 3 doubles as input (a, b,c ).

Next those 3 values get calculated in a formula (abc formula for square roots).

The formula has 2 values that have to be returned but how exactly do i do this?

I was thinking of a array / objects, but not sure how to initialise them for this purpose. Out parameters are not really of any use in this situation are they?

Regards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:30:04+00:00Added an answer on May 18, 2026 at 8:30 am

    In C# 4 (available in Visual Studio 2010):

    Tuple<double, double> Foo(double a, double b, double c)
    {
       ...
       return Tuple.Create(firstReturnValue, secondReturnValue);
    }
    

    If you’re working with an earlier language version of C#, you can define your own implementation of a two-tuple (pair) as follows:

    public struct Tuple<A, B>
    {
       public readonly A Item1;
       public readonly B Item2;
       public Tuple(A a, B b) { Item1 = a; Item2 = b; }
    }
    public static class Tuple
    {
       public static Tuple<A,B> Create<A,B>(A a, B b) { return new Tuple<A,B>(a,b); }
    }
    

    Of course, Tuple is a very general and unspecific data type. You could just as well implement a composite return type (similar to what I just showed, but simpler) that is more specific to your situation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a program that randomly assembles mathematical expressions using the values stored in
I'm interested in an operator, swap-arg, that takes as input 1) a function f
This is a design principle question for classes dealing with mathematical/physical equations where the
I know this question is difficult to understand but I need a mathematical equation
I have a Java method that repeatedly evaluates the following expression in a very
I've created some mathematical functions that will be used in main() and by member
Of course one should never compare floating point values that result from a calculation
Let us take this example scenario: There exists a really complex function that involves
Lets assume i have a function that takes 32bit integer in, and returns random
Greetings. I have a java method that I consider expensive, and I'm trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.